Interface QueryCapableProtocolModule<TKind, TAdapter, TQueryBinding>

Atomic query-capable extension of ProtocolModule.

A module either implements this interface and therefore provides both hooks, or implements the discovery-only base interface and provides neither. Keeping the pair in a separate required interface prevents partially executable modules from satisfying the public contract.

interface QueryCapableProtocolModule<TKind, TAdapter, TQueryBinding> {
    environments: readonly ProtocolModuleEnvironment[];
    kind: TKind;
    peer?: unknown;
    capabilities(descriptor: SourceDescriptor<Protocol | TKind>): Capabilities;
    compile(input: ProtocolModuleQueryCompileInput<TQueryBinding["source"], TQueryBinding["compileQuery"]>): TQueryBinding["compiled"];
    discover(descriptor: SourceDescriptor<Protocol | TKind>, options?: ProtocolModuleDiscoverOptions): ProtocolModuleHandle<TAdapter, Protocol | TKind> | Promise<ProtocolModuleHandle<TAdapter, Protocol | TKind>>;
    execute<TRecord>(handle: ProtocolModuleHandle<TAdapter, Protocol | TKind>, input: ProtocolModuleQueryExecuteInput<TQueryBinding["compiled"], TQueryBinding["executeQuery"]>): Promise<Result<TRecord>>;
}

Type Parameters

Hierarchy (view full)

Properties

environments: readonly ProtocolModuleEnvironment[]
kind: TKind
peer?: unknown

Methods