Home / Class/ ExpoSQLiteTransaction Class — drizzle-orm Architecture

ExpoSQLiteTransaction Class — drizzle-orm Architecture

Architecture documentation for the ExpoSQLiteTransaction class in session.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  582d61b1_dcfe_d017_91df_08dd055770c5["ExpoSQLiteTransaction"]
  ddcc8973_fc9e_23b4_1e3c_d3ff67e9b7e4["session.ts"]
  582d61b1_dcfe_d017_91df_08dd055770c5 -->|defined in| ddcc8973_fc9e_23b4_1e3c_d3ff67e9b7e4
  2172fba2_3bb2_e7ff_1224_cddfe2d9d7d5["transaction()"]
  582d61b1_dcfe_d017_91df_08dd055770c5 -->|method| 2172fba2_3bb2_e7ff_1224_cddfe2d9d7d5

Relationship Graph

Source Code

drizzle-orm/src/expo-sqlite/session.ts lines 79–98

export class ExpoSQLiteTransaction<
	TFullSchema extends Record<string, unknown>,
	TSchema extends TablesRelationalConfig,
> extends SQLiteTransaction<'sync', SQLiteRunResult, TFullSchema, TSchema> {
	static override readonly [entityKind]: string = 'ExpoSQLiteTransaction';

	override transaction<T>(transaction: (tx: ExpoSQLiteTransaction<TFullSchema, TSchema>) => T): T {
		const savepointName = `sp${this.nestedIndex}`;
		const tx = new ExpoSQLiteTransaction('sync', this.dialect, this.session, this.schema, this.nestedIndex + 1);
		this.session.run(sql.raw(`savepoint ${savepointName}`));
		try {
			const result = transaction(tx);
			this.session.run(sql.raw(`release savepoint ${savepointName}`));
			return result;
		} catch (err) {
			this.session.run(sql.raw(`rollback to savepoint ${savepointName}`));
			throw err;
		}
	}
}

Domain

Frequently Asked Questions

What is the ExpoSQLiteTransaction class?
ExpoSQLiteTransaction is a class in the drizzle-orm codebase, defined in drizzle-orm/src/expo-sqlite/session.ts.
Where is ExpoSQLiteTransaction defined?
ExpoSQLiteTransaction is defined in drizzle-orm/src/expo-sqlite/session.ts at line 79.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free