withStatement Method

Prepared and execute a callback on an ECSQL statement. After the callback completes the statement is disposed. Use this method for ECSQL statements are either not expected to be reused, or are not expensive to prepare. For statements that will be reused often, instead use withPreparedStatement.

withStatement<T>(ecsql: string, callback: (stmt: ECSqlStatement) => T, logErrors: booleantrue): T

@returns the value returned by callback.

@see withPreparedStatement

Parameter Type Description
ecsql string  
callback (stmt: ECSqlStatement) => T the callback to invoke on the prepared statement
logErrors boolean Determines if error will be logged if statement fail to prepare

Returns - T

the value returned by callback.

Defined in

Last Updated: 17 December, 2024