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
  33852796_71eb_674e_24b2_c4afc4cd08de["transaction()"]
  02d0c510_ed76_17a4_347a_0a7ad3ef5c35["SQLiteBunSession"]
  33852796_71eb_674e_24b2_c4afc4cd08de -->|defined in| 02d0c510_ed76_17a4_347a_0a7ad3ef5c35
  840ddddb_7761_fedb_1386_3c3456b2caa8["transaction()"]
  840ddddb_7761_fedb_1386_3c3456b2caa8 -->|calls| 33852796_71eb_674e_24b2_c4afc4cd08de
  840ddddb_7761_fedb_1386_3c3456b2caa8["transaction()"]
  33852796_71eb_674e_24b2_c4afc4cd08de -->|calls| 840ddddb_7761_fedb_1386_3c3456b2caa8
  style 33852796_71eb_674e_24b2_c4afc4cd08de fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/bun-sqlite/session.ts lines 68–79

	override transaction<T>(
		transaction: (tx: SQLiteBunTransaction<TFullSchema, TSchema>) => T,
		config: SQLiteTransactionConfig = {},
	): T {
		const tx = new SQLiteBunTransaction('sync', this.dialect, this, this.schema);
		let result: T | undefined;
		const nativeTx = this.client.transaction(() => {
			result = transaction(tx);
		});
		nativeTx[config.behavior ?? 'deferred']();
		return result!;
	}

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/bun-sqlite/session.ts.
Where is transaction() defined?
transaction() is defined in drizzle-orm/src/bun-sqlite/session.ts at line 68.
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