Home / Function/ transaction() — drizzle-orm Function Reference

transaction() — drizzle-orm Function Reference

Architecture documentation for the transaction() function in session.ts from the drizzle-orm codebase.

Entity Profile

Dependency Diagram

graph TD
  731efcce_91b3_f2d8_b038_268ef8f3a226["transaction()"]
  7a5a243a_5865_a6b8_4241_75b36641bad7["GelDbSession"]
  731efcce_91b3_f2d8_b038_268ef8f3a226 -->|defined in| 7a5a243a_5865_a6b8_4241_75b36641bad7
  ca4764f6_7a8e_03a2_61f9_d8b45d36c681["transaction()"]
  ca4764f6_7a8e_03a2_61f9_d8b45d36c681 -->|calls| 731efcce_91b3_f2d8_b038_268ef8f3a226
  ca4764f6_7a8e_03a2_61f9_d8b45d36c681["transaction()"]
  731efcce_91b3_f2d8_b038_268ef8f3a226 -->|calls| ca4764f6_7a8e_03a2_61f9_d8b45d36c681
  style 731efcce_91b3_f2d8_b038_268ef8f3a226 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/gel/session.ts lines 154–162

	override async transaction<T>(
		transaction: (tx: GelTransaction<GelQueryResultHKT, TFullSchema, TSchema>) => Promise<T>,
	): Promise<T> {
		return await (this.client as Client).transaction(async (clientTx) => {
			const session = new GelDbSession(clientTx, this.dialect, this.schema, this.options);
			const tx = new GelDbTransaction<TFullSchema, TSchema>(this.dialect, session, this.schema);
			return await transaction(tx);
		});
	}

Domain

Subdomains

Called By

Frequently Asked Questions

What does transaction() do?
transaction() is a function in the drizzle-orm codebase, defined in drizzle-orm/src/gel/session.ts.
Where is transaction() defined?
transaction() is defined in drizzle-orm/src/gel/session.ts at line 154.
What does transaction() call?
transaction() calls 1 function(s): transaction.
What calls transaction()?
transaction() is called by 1 function(s): transaction.

Analyze Your Own Codebase

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

Try Supermodel Free