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 Determines if error will be logged if statement fail to prepare

Returns - T

the value returned by callback.

Defined in

Last Updated: 14 November, 2024