/** @packageDocumentation * @module iModels */ import { DbQueryRequest, DbQueryResponse, DbRequestExecutor, QueryBinder, QueryOptions, QueryPropertyMetaData } from "./ConcurrentQuery"; import { ECSqlReaderBase, QueryRowProxy } from "./ECSqlReaderBase"; /** * Performance-related statistics for [[ECSqlReader]]. * @public */ export interface QueryStats { /** Time spent running the query; not including time spent queued. Time is in microseconds */ backendCpuTime: number; /** Total time it took the backend to run the query. Time is in milliseconds. */ backendTotalTime: number; /** Estimated memory used for the query. */ backendMemUsed: number; /** Total number of rows returned by the backend. */ backendRowsReturned: number; /** The total round trip time from the client's perspective. Time is in milliseconds. */ totalTime: number; /** The number of retries attempted to execute the query. */ retryCount: number; /** Total time in millisecond to prepare ECSQL or grabing it from cache and binding parameters */ prepareTime: number; } /** * Execute ECSQL statements and read the results. * * The query results are returned one row at a time. The format of the row is dictated by the * [[QueryOptions.rowFormat]] specified in the `options` parameter of the constructed ECSqlReader object. Defaults to * [[QueryRowFormat.UseECSqlPropertyIndexes]] when no `rowFormat` is defined. * * There are three primary ways to interact with and read the results: * - Stream them using ECSqlReader as an asynchronous iterator. * - Iterator over them manually using [[ECSqlReader.step]]. * - Capture all of the results at once in an array using [[QueryRowProxy.toArray]]. * * @see * - [ECSQL Overview]($docs/learning/backend/ExecutingECSQL) * - [ECSQL Row Formats]($docs/learning/ECSQLRowFormat) for more details on how rows are formatted. * - [ECSQL Code Examples]($docs/learning/ECSQLCodeExamples#iterating-over-query-results) for examples of each * of the above ways of interacting with ECSqlReader. * * @note When iterating over the results, the current row will be a [[QueryRowProxy]] object. To get the row as a basic * JavaScript object, call [[QueryRowProxy.toRow]] on it. * @public */ export declare class ECSqlReader extends ECSqlReaderBase implements AsyncIterableIterator { private _executor; readonly query: string; private static readonly _maxRetryCount; private _localRows; private _localOffset; private _globalOffset; private _globalCount; private _globalDone; private _param; private _lockArgs; private _stats; private _options; /** * @internal */ constructor(_executor: DbRequestExecutor, query: string, param?: QueryBinder, options?: QueryOptions); /** * @deprecated in 5.6 - will not be removed until after 2027-04-02. Will not be removed until 2027-02-18. Should not be used. Will be made private in a future release. */ setParams(param: QueryBinder): void; /** * @deprecated in 5.6 - will not be removed until after 2027-04-02. Will not be removed until 2027-02-18. Should not be used. Will be made private in a future release. */ reset(options?: QueryOptions): void; /** * Clear all bindings. * @deprecated in 5.6 - will not be removed until after 2027-04-02. Will not be removed until 2027-02-18. Should not be used. Will be made private in a future release. */ resetBindings(): void; /** * @internal */ getRowInternal(): any[]; /** * Get performance-related statistics for the current query. */ get stats(): QueryStats; /** * */ private readRows; /** * @internal */ protected runWithRetry(request: DbQueryRequest): Promise; /** * Get the metadata for each column in the query result. * * @returns An array of [[QueryPropertyMetaData]]. */ getMetaData(): Promise; /** * */ private fetchRows; /** * Step to the next row of the query result. * * @returns `true` if a row can be read from `current`.
* `false` if there are no more rows; i.e., all rows have been stepped through already. */ step(): Promise; /** * Get all remaining rows from the query result. * * @returns An array of all remaining rows from the query result. */ toArray(): Promise; /** * Accessor for using ECSqlReader as an asynchronous iterator. * * @returns An asynchronous iterator over the rows returned by the executed ECSQL query. */ [Symbol.asyncIterator](): AsyncIterableIterator; /** * Calls step when called as an iterator. * * Returns the row alongside a `done` boolean to indicate if there are any more rows for an iterator to step to. * * @returns An object with the keys: `value` which contains the row and `done` which contains a boolean. */ next(): Promise>; } //# sourceMappingURL=ECSqlReader.d.ts.map