Home / Class/ SQLiteProxyTransaction Class — drizzle-orm Architecture

SQLiteProxyTransaction Class — drizzle-orm Architecture

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

Entity Profile

Dependency Diagram

graph TD
  fd9e1e8d_8470_d91a_8e8d_5f87d3c0bb27["SQLiteProxyTransaction"]
  78995e64_a0d0_1533_378c_3e7415ac2520["session.ts"]
  fd9e1e8d_8470_d91a_8e8d_5f87d3c0bb27 -->|defined in| 78995e64_a0d0_1533_378c_3e7415ac2520
  6eb2105d_a07f_dc00_c56f_931a711ee608["transaction()"]
  fd9e1e8d_8470_d91a_8e8d_5f87d3c0bb27 -->|method| 6eb2105d_a07f_dc00_c56f_931a711ee608

Relationship Graph

Source Code

drizzle-orm/src/sqlite-proxy/session.ts lines 120–141

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

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

Domain

Frequently Asked Questions

What is the SQLiteProxyTransaction class?
SQLiteProxyTransaction is a class in the drizzle-orm codebase, defined in drizzle-orm/src/sqlite-proxy/session.ts.
Where is SQLiteProxyTransaction defined?
SQLiteProxyTransaction is defined in drizzle-orm/src/sqlite-proxy/session.ts at line 120.

Analyze Your Own Codebase

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

Try Supermodel Free