withSqliteStatement Method

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

withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T): T

Parameter Type Description
sql string The SQLite SQL statement to execute
callback (stmt: SqliteStatement) => T the callback to invoke on the prepared statement

Returns - T

the value returned by callback.

Defined in

Last Updated: 12 June, 2024