Home / Class/ SingleStoreDriverTransaction Class — drizzle-orm Architecture

SingleStoreDriverTransaction Class — drizzle-orm Architecture

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

Entity Profile

Dependency Diagram

graph TD
  d99a9a29_a84e_fe26_23e2_747611bfea48["SingleStoreDriverTransaction"]
  62c65d67_46f9_0c5c_7e91_734bbcfd68cd["session.ts"]
  d99a9a29_a84e_fe26_23e2_747611bfea48 -->|defined in| 62c65d67_46f9_0c5c_7e91_734bbcfd68cd
  8a26552d_acc1_0ef9_c339_f7c6004922f3["transaction()"]
  d99a9a29_a84e_fe26_23e2_747611bfea48 -->|method| 8a26552d_acc1_0ef9_c339_f7c6004922f3

Relationship Graph

Source Code

drizzle-orm/src/singlestore/session.ts lines 320–351

export class SingleStoreDriverTransaction<
	TFullSchema extends Record<string, unknown>,
	TSchema extends TablesRelationalConfig,
> extends SingleStoreTransaction<
	SingleStoreDriverQueryResultHKT,
	SingleStoreDriverPreparedQueryHKT,
	TFullSchema,
	TSchema
> {
	static override readonly [entityKind]: string = 'SingleStoreDriverTransaction';

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

Domain

Frequently Asked Questions

What is the SingleStoreDriverTransaction class?
SingleStoreDriverTransaction is a class in the drizzle-orm codebase, defined in drizzle-orm/src/singlestore/session.ts.
Where is SingleStoreDriverTransaction defined?
SingleStoreDriverTransaction is defined in drizzle-orm/src/singlestore/session.ts at line 320.

Analyze Your Own Codebase

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

Try Supermodel Free