Home / Class/ PrismaPgSession Class — drizzle-orm Architecture

PrismaPgSession Class — drizzle-orm Architecture

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

Entity Profile

Dependency Diagram

graph TD
  d0d1ff83_34d6_a16a_84ab_5cb4f8b60ae2["PrismaPgSession"]
  3260517d_a12c_a392_fb71_4aac0c61619f["session.ts"]
  d0d1ff83_34d6_a16a_84ab_5cb4f8b60ae2 -->|defined in| 3260517d_a12c_a392_fb71_4aac0c61619f
  7b281f7e_eb3f_8e06_920f_b8b9638fb3d2["constructor()"]
  d0d1ff83_34d6_a16a_84ab_5cb4f8b60ae2 -->|method| 7b281f7e_eb3f_8e06_920f_b8b9638fb3d2
  f50b722a_97a7_5ae7_37da_d0ac40c8e4ca["execute()"]
  d0d1ff83_34d6_a16a_84ab_5cb4f8b60ae2 -->|method| f50b722a_97a7_5ae7_37da_d0ac40c8e4ca
  8b8fd7be_0394_41ab_e98e_c056dc5df658["prepareQuery()"]
  d0d1ff83_34d6_a16a_84ab_5cb4f8b60ae2 -->|method| 8b8fd7be_0394_41ab_e98e_c056dc5df658
  28e2417d_781e_abf5_6c62_6677ef3ebac9["transaction()"]
  d0d1ff83_34d6_a16a_84ab_5cb4f8b60ae2 -->|method| 28e2417d_781e_abf5_6c62_6677ef3ebac9

Relationship Graph

Source Code

drizzle-orm/src/prisma/pg/session.ts lines 46–74

export class PrismaPgSession extends PgSession {
	static override readonly [entityKind]: string = 'PrismaPgSession';

	private readonly logger: Logger;

	constructor(
		dialect: PgDialect,
		private readonly prisma: PrismaClient,
		private readonly options: PrismaPgSessionOptions,
	) {
		super(dialect);
		this.logger = options.logger ?? new NoopLogger();
	}

	override execute<T>(query: SQL): Promise<T> {
		return this.prepareQuery<PreparedQueryConfig & { execute: T }>(this.dialect.sqlToQuery(query)).execute();
	}

	override prepareQuery<T extends PreparedQueryConfig = PreparedQueryConfig>(query: Query): PgPreparedQuery<T> {
		return new PrismaPgPreparedQuery(this.prisma, query, this.logger);
	}

	override transaction<T>(
		_transaction: (tx: PgTransaction<PgQueryResultHKT, Record<string, never>, Record<string, never>>) => Promise<T>,
		_config?: PgTransactionConfig,
	): Promise<T> {
		throw new Error('Method not implemented.');
	}
}

Domain

Frequently Asked Questions

What is the PrismaPgSession class?
PrismaPgSession is a class in the drizzle-orm codebase, defined in drizzle-orm/src/prisma/pg/session.ts.
Where is PrismaPgSession defined?
PrismaPgSession is defined in drizzle-orm/src/prisma/pg/session.ts at line 46.

Analyze Your Own Codebase

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

Try Supermodel Free