NitroSQLite
react-native-nitro-sqlite-drizzleClasses

NitroSQLiteTransaction

TypeScript

Source files: TypeScript

Drizzle transaction handle supplied to a transaction callback. Use it for queries and nested transactions only while the callback is active. Inherited rollback() throws Drizzle's TransactionRollbackError; an error escaping the outer callback becomes a NitroSQLiteError with message Rollback.

Extends

Type Parameters

TFullSchema

TFullSchema extends Record<string, unknown>

Full schema object supplied to Drizzle.

TSchema

TSchema extends TablesRelationalConfig

Relational table configuration extracted from that schema.

Constructors

Constructor

new NitroSQLiteTransaction<TFullSchema, TSchema>(resultType, dialect, session, schema, nestedIndex?): NitroSQLiteTransaction<TFullSchema, TSchema>

Defined in: node_modules/drizzle-orm/sqlite-core/session.d.ts:98

Parameters

resultType

"async"

dialect

SQLiteAsyncDialect

session

SQLiteSession<"async", NitroSQLiteRawQueryResult, TFullSchema, TSchema>

schema

{ } | undefined

nestedIndex?

number

Returns

NitroSQLiteTransaction<TFullSchema, TSchema>

Inherited from

SQLiteTransaction< 'async', NitroSQLiteRawQueryResult, TFullSchema, TSchema >.constructor

Properties

dialect

readonly dialect: SQLiteAsyncDialect

Defined in: packages/react-native-nitro-sqlite-drizzle/src/drizzle-orm.ts:49

Inherited from

SQLiteTransaction.dialect


session

readonly session: SQLiteSession<"async", NitroSQLiteRawQueryResult, TFullSchema, TSchema>

Defined in: packages/react-native-nitro-sqlite-drizzle/src/drizzle-orm.ts:53

Inherited from

SQLiteTransaction.session

Methods

transaction()

transaction<T>(transaction): Promise<T>

Defined in: packages/react-native-nitro-sqlite-drizzle/src/session.ts:169

Run a nested transaction using a SQLite savepoint.

Type Parameters

T

T

Nested callback result type.

Parameters

transaction

(tx) => Promise<T>

Callback whose changes roll back to the savepoint if it throws.

Returns

Promise<T>

The callback result after releasing the savepoint.

Throws

Rejects with the callback error, or a query error if savepoint operations fail. Catch the rejection in the outer callback to continue that transaction.

Overrides

SQLiteTransaction.transaction

On this page