NitroSQLite
react-native-nitro-sqliteInterfaces

PreparedStatement

TypeScript

Source files: TypeScript

A reusable SQL statement bound to the connection that prepared it. Each execution resets the statement and its bindings before applying new values. Finalize it before closing the connection.

Properties

execute

Defined in: types.ts:290

Execute on the calling thread. Throws if the statement is finalized, its connection is closed, or the managed connection is busy.


executeAsync

Defined in: types.ts:292

Queue execution on a background thread and resolve with the query result.


executeRaw

Defined in: types.ts:308

Execute on the calling thread like execute, returning rows as arrays of column values.


executeRawAsync

Defined in: types.ts:310

Queue execution like executeAsync and resolve with rows as arrays of column values.


isFinalized

readonly isFinalized: boolean

Defined in: types.ts:288

Whether finalize() has released the native statement.

Methods

executeLazy()

executeLazy<Row>(params?): LazyQueryResult<Row>

Defined in: types.ts:297

Execute on the calling thread with new bindings and convert rows on demand. Throws if the statement is finalized, the connection is closed or busy, or execution fails.

Type Parameters

Row

Row extends QueryResultRow = QueryResultRow

Parameters

params?

SQLiteQueryParams

Values bound to the statement's positional placeholders.

Returns

LazyQueryResult<Row>


executeLazyAsync()

executeLazyAsync<Row>(params?): Promise<LazyQueryResult<Row>>

Defined in: types.ts:304

Queue execution with new bindings and resolve with rows that convert on access. Rejects if the statement is finalized, the connection is closed, or execution fails.

Type Parameters

Row

Row extends QueryResultRow = QueryResultRow

Parameters

params?

SQLiteQueryParams

Values bound to the statement's positional placeholders.

Returns

Promise<LazyQueryResult<Row>>


finalize()

finalize(): void

Defined in: types.ts:312

Release the native statement. Calling this more than once is safe.

Returns

void

On this page