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 withPreparedSqliteStatement.
withSqliteStatement<T>(sql: string, callback: (stmt: SqliteStatement) => T, logErrors: booleantrue): T
@returns the value returned by callback
.
Parameter | Type | Description |
---|---|---|
sql | string | The SQLite SQL statement to execute |
callback | (stmt: SqliteStatement) => T | the callback to invoke on the prepared statement |
logErrors | boolean | Determine if errors are logged or not |
Returns - T
the value returned by callback
.
Defined in
- core/backend/src/IModelDb.ts Line 593
Last Updated: 23 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.