UNPKG

couchbase

Version:

The official Couchbase Node.js Client Library.

48 lines (47 loc) • 1.89 kB
import { CppError, CppQueryResponse } from './binding'; import { Cluster } from './cluster'; import { ObservableRequestHandler } from './observabilityhandler'; import { ObservabilityInstruments } from './observabilitytypes'; import { QueryMetaData, QueryOptions, QueryResult } from './querytypes'; import { StreamableRowPromise } from './streamablepromises'; /** * @internal */ export declare class QueryExecutor { private _cluster; /** * @internal */ constructor(cluster: Cluster); /** * @internal */ get observabilityInstruments(): ObservabilityInstruments; /** * @internal * * Native callbacks swallow anything thrown out of them, so anything still * thrown by the callback body (an 'error' emitted with no listener, or a * throwing 'end' listener) is rethrown on a later tick, where it surfaces as * an uncaught exception. */ static _rethrowListenerErrors(fn: () => void): void; /** * @internal */ static _processQueryResponse<TRow>(emitter: StreamableRowPromise<QueryResult<TRow>, TRow, QueryMetaData>, err: Error | null, resp: CppQueryResponse, obsReqHandler?: ObservableRequestHandler): void; /** * @internal * * Used by transactions (observability currently not available for transactions) */ static execute<TRow = any>(exec: (callback: (err: CppError | null, resp: CppQueryResponse) => void) => void): StreamableRowPromise<QueryResult<TRow>, TRow, QueryMetaData>; /** * @internal */ static executePromise<TRow = any>(queryPromise: Promise<[Error | null, CppQueryResponse]>, obsReqHandler: ObservableRequestHandler): StreamableRowPromise<QueryResult<TRow>, TRow, QueryMetaData>; /** * @internal */ query<TRow = any>(query: string, options: QueryOptions): StreamableRowPromise<QueryResult<TRow>, TRow, QueryMetaData>; }