restartQuery Method

Deprecated  in 3.7. Use IModelDb.createQueryReader instead. Pass in the restart token as part of the config argument; e.g., { restartToken: myToken } or new QueryOptionsBuilder().setRestartToken(myToken).getOptions().

Cancel any previous query with same token and run execute the current specified query. 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:

restartQuery(token: string, ecsql: string, params?: QueryBinder, options?: QueryOptions): AsyncIterableIterator<any>

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

Parameter Type Description
token string None empty restart token. The previous query with same token would be cancelled. This would cause
exception which user code must handle.
ecsql string The ECSQL statement to execute
params QueryBinder The values to bind to the parameters (if the ECSQL has any).
options QueryOptions Allow to specify certain flags which control how query is executed.

Returns - AsyncIterableIterator<any>

Returns the query result as an AsyncIterableIterator which lazy load result as needed. The row format is determined by rowFormat parameter. See ECSQL row format for details about the format of the returned rows.

Defined in

Last Updated: 30 November, 2023