NitroSQLite
react-native-nitro-sqliteHybrid Objects

NativePreparedStatement

TypeScriptC++

Source files: TypeScript · C++

Native prepared statement returned by NitroSQLite.native.prepare().

Extends

  • NativeHybridObject

Properties

isFinalized

readonly isFinalized: boolean

Defined in: packages/react-native-nitro-sqlite/src/specs/PreparedStatement.nitro.ts:28

Whether the native statement has been finalized.

Methods

execute()

execute(params?): NativeQueryResultBinding

Defined in: packages/react-native-nitro-sqlite/src/specs/PreparedStatement.nitro.ts:35

Execute on the calling thread, replacing the previous parameter bindings. Throws after finalization or connection closure.

Parameters

params?

SQLiteQueryParams

Values bound to positional placeholders.

Returns

NativeQueryResultBinding

Native query rows, affected row count, insert ID, and metadata.


executeAsync()

executeAsync(params?): Promise<NativeQueryResultBinding>

Defined in: packages/react-native-nitro-sqlite/src/specs/PreparedStatement.nitro.ts:42

Execute on the connection's background thread, replacing the previous parameter bindings. Executions run in call order with the connection's other async calls. Rejects after finalization or connection closure.

Parameters

params?

SQLiteQueryParams

Values bound to positional placeholders.

Returns

Promise<NativeQueryResultBinding>

A promise of the native query result.


executeLazy()

executeLazy(params?): NativeLazyQueryResult

Defined in: packages/react-native-nitro-sqlite/src/specs/PreparedStatement.nitro.ts:48

Execute with new bindings on the calling thread and convert rows on demand.

Parameters

params?

SQLiteQueryParams

Values bound to positional placeholders.

Returns

NativeLazyQueryResult

Rows that remain usable after the statement is finalized.

Throws

If the statement is finalized, the connection is closed, or execution fails.


executeLazyAsync()

executeLazyAsync(params?): Promise<NativeLazyQueryResult>

Defined in: packages/react-native-nitro-sqlite/src/specs/PreparedStatement.nitro.ts:54

Execute like executeLazy on the connection's background worker. Executions run in call order with the connection's other async calls.

Parameters

params?

SQLiteQueryParams

Values bound to positional placeholders.

Returns

Promise<NativeLazyQueryResult>

A promise that resolves with the completed result and rejects on failure.


executeRaw()

executeRaw(params?): NativeRawQueryResult

Defined in: packages/react-native-nitro-sqlite/src/specs/PreparedStatement.nitro.ts:59

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

Parameters

params?

SQLiteQueryParams

Values bound to positional placeholders.

Returns

NativeRawQueryResult

Column names, rows as value arrays, affected row count, and insert ID.


executeRawAsync()

executeRawAsync(params?): Promise<NativeRawQueryResult>

Defined in: packages/react-native-nitro-sqlite/src/specs/PreparedStatement.nitro.ts:64

Execute on a background thread like executeAsync, returning rows as arrays of column values.

Parameters

params?

SQLiteQueryParams

Values bound to positional placeholders.

Returns

Promise<NativeRawQueryResult>

A promise of the native raw query result.


finalize()

finalize(): void

Defined in: packages/react-native-nitro-sqlite/src/specs/PreparedStatement.nitro.ts:66

Release the native statement. Repeated calls are safe.

Returns

void