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
  2e54fc70_c916_df62_543e_cf9509a3df9e["transaction()"]
  df07f92c_5121_7fc0_a5fb_37eda76ba69c["PostgresJsTransaction"]
  2e54fc70_c916_df62_543e_cf9509a3df9e -->|defined in| df07f92c_5121_7fc0_a5fb_37eda76ba69c
  b0468bd2_9214_c521_acfe_8881e2e1c3be["transaction()"]
  b0468bd2_9214_c521_acfe_8881e2e1c3be -->|calls| 2e54fc70_c916_df62_543e_cf9509a3df9e
  b0468bd2_9214_c521_acfe_8881e2e1c3be["transaction()"]
  2e54fc70_c916_df62_543e_cf9509a3df9e -->|calls| b0468bd2_9214_c521_acfe_8881e2e1c3be
  style 2e54fc70_c916_df62_543e_cf9509a3df9e fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

drizzle-orm/src/postgres-js/session.ts lines 203–216

	override transaction<T>(
		transaction: (tx: PostgresJsTransaction<TFullSchema, TSchema>) => Promise<T>,
	): Promise<T> {
		return this.session.client.savepoint((client) => {
			const session = new PostgresJsSession<TransactionSql, TFullSchema, TSchema>(
				client,
				this.dialect,
				this.schema,
				this.session.options,
			);
			const tx = new PostgresJsTransaction<TFullSchema, TSchema>(this.dialect, session, this.schema);
			return transaction(tx);
		}) as Promise<T>;
	}

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