ECSqlReader Class

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 rowFormat specified in the options parameter of the constructed ECSqlReader object. Defaults to 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 toArray.

@see - ECSQL Overview

@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.

Extends

Implements

Methods

Name Description
[asyncIterator](): AsyncIterableIterator<QueryRowProxy, any, any> Accessor for using ECSqlReader as an asynchronous iterator.  
Get the metadata for each column in the query result.  
next(): Promise<IteratorResult<QueryRowProxy, any>> Calls step when called as an iterator.  
reset(options?: QueryOptions): void   Deprecated  
resetBindings(): void Clear all bindings. Deprecated  
setParams(param: QueryBinder): void   Deprecated  
step(): Promise<boolean> Step to the next row of the query result.  
toArray(): Promise<any[]> Get all remaining rows from the query result.  

Properties

Name Type Description
query Readonly string    
stats Accessor ReadOnly QueryStats Get performance-related statistics for the current query.  

Inherited properties

Name Type Inherited from Description
current Accessor Inherited ReadOnly QueryRowProxy ECSqlReaderBase Get the current row from the query result. The current row is the one most recently stepped-to
(by step() or during iteration).

Each value from the row can be accessed by index or by name.
done Accessor Inherited ReadOnly boolean ECSqlReaderBase Returns if there are more rows available.

Defined in

Last Updated: 21 March, 2026