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 b0468bd2_9214_c521_acfe_8881e2e1c3be["transaction()"] 1053eb6c_20a0_7889_a53b_cfa06854e18b["PostgresJsSession"] b0468bd2_9214_c521_acfe_8881e2e1c3be -->|defined in| 1053eb6c_20a0_7889_a53b_cfa06854e18b 2e54fc70_c916_df62_543e_cf9509a3df9e["transaction()"] 2e54fc70_c916_df62_543e_cf9509a3df9e -->|calls| b0468bd2_9214_c521_acfe_8881e2e1c3be 2e54fc70_c916_df62_543e_cf9509a3df9e["transaction()"] b0468bd2_9214_c521_acfe_8881e2e1c3be -->|calls| 2e54fc70_c916_df62_543e_cf9509a3df9e style b0468bd2_9214_c521_acfe_8881e2e1c3be fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
drizzle-orm/src/postgres-js/session.ts lines 167–184
override transaction<T>(
transaction: (tx: PostgresJsTransaction<TFullSchema, TSchema>) => Promise<T>,
config?: PgTransactionConfig,
): Promise<T> {
return this.client.begin(async (client) => {
const session = new PostgresJsSession<TransactionSql, TFullSchema, TSchema>(
client,
this.dialect,
this.schema,
this.options,
);
const tx = new PostgresJsTransaction(this.dialect, session, this.schema);
if (config) {
await tx.setTransaction(config);
}
return transaction(tx);
}) as Promise<T>;
}
Domain
Subdomains
Defined In
Calls
Called By
Source
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 167.
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