query Method


Execute a query and stream its results The result of the query is async iterator over the rows. The iterator will get next page automatically once rows in current page has been read. ECSQL row.

See also:

query(ecsql: string, bindings?: any[] | object, limitRows?: number, quota?: QueryQuota, priority?: QueryPriority): AsyncIterableIterator<any>

throws IModelError If there was any error while submitting, preparing or stepping into query

Parameter Type Description
ecsql string The ECSQL statement to execute
bindings any[] | object The values to bind to the parameters (if the ECSQL has any).
Pass an array of values if the parameters are positional.
Pass an object of the values keyed on the parameter name for named parameters.
The values in either the array or object must match the respective types of the parameters.
See "iModel.js Types used in ECSQL Parameter Bindings" for details.
limitRows number Specify upper limit for rows that can be returned by the query.
quota QueryQuota Specify non binding quota. These values are constrained by global setting
but never the less can be specified to narrow down the quota constraint for the query but staying under global settings.
priority QueryPriority Specify non binding priority for the query. It can help user to adjust
priority of query in queue so that small and quicker queries can be prioritized over others.

Returns - Returns the query result as an AsyncIterableIterator which lazy load result as needed See ECSQL row format for details about the format of the returned rows.

Defined in

Last Updated: 12 February, 2020