Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

QueryExecutor

This interface abstracts away the details of how to compile a query into SQL and execute it. Instead of passing around all those details, SelectQueryBuilder and other classes that execute queries can just pass around and instance of QueryExecutor.

interface QueryExecutor extends ConnectionProvider {
get adapter(): DialectAdapter;
compileQuery<R = unknown>(node: RootOperationNode, queryId: QueryId): CompiledQuery<R>;
executeQuery<R>(compiledQuery: CompiledQuery<R>, queryId: QueryId): Promise<QueryResult<R>>;
get plugins(): ReadonlyArray<KyselyPlugin>;
stream<R>(
compiledQuery: CompiledQuery<R>,
chunkSize: number,
queryId: QueryId,
): AsyncIterableIterator<QueryResult<R>>;
transformQuery<T extends RootOperationNode>(node: T, queryId: QueryId): T;
withConnectionProvider(connectionProvider: ConnectionProvider): QueryExecutor;
withoutPlugins(): QueryExecutor;
withPlugin(plugin: KyselyPlugin): QueryExecutor;
withPluginAtFront(plugin: KyselyPlugin): QueryExecutor;
withPlugins(plugin: ReadonlyArray<KyselyPlugin>): QueryExecutor;
}

§Extends

§Methods

§
get adapter(): DialectAdapter
[src]

Returns the adapter for the current dialect.

§
compileQuery<R = unknown>(node: RootOperationNode, queryId: QueryId): CompiledQuery<R>
[src]

Compiles the transformed query into SQL. You usually want to pass the output of {@link transformQuery} into this method but you can compile any query using this method.

§
executeQuery<R>(compiledQuery: CompiledQuery<R>, queryId: QueryId): Promise<QueryResult<R>>
[src]

Executes a compiled query and runs the result through all plugins' transformResult method.

§
get plugins(): ReadonlyArray<KyselyPlugin>
[src]

Returns all installed plugins.

§
stream<R>(
compiledQuery: CompiledQuery<R>,
chunkSize: number,
queryId: QueryId,
): AsyncIterableIterator<QueryResult<R>>
[src]

Executes a compiled query and runs the result through all plugins' transformResult method. Results are streamead instead of loaded at once.

§
transformQuery<T extends RootOperationNode>(node: T, queryId: QueryId): T
[src]

Given the query the user has built (expressed as an operation node tree) this method runs it through all plugins' transformQuery methods and returns the result.

§
withConnectionProvider(connectionProvider: ConnectionProvider): QueryExecutor
[src]

Returns a copy of this executor with a new connection provider.

§
withoutPlugins(): QueryExecutor
[src]

Returns a copy of this executor without any plugins.

§
withPlugin(plugin: KyselyPlugin): QueryExecutor
[src]

Returns a copy of this executor with a plugin added as the last plugin.

§
withPluginAtFront(plugin: KyselyPlugin): QueryExecutor
[src]

Returns a copy of this executor with a plugin added as the first plugin.

§
withPlugins(plugin: ReadonlyArray<KyselyPlugin>): QueryExecutor
[src]

Returns a copy of this executor with a list of plugins added as the last plugins.