Home / File/ session.ts — drizzle-orm Source File

session.ts — drizzle-orm Source File

Architecture documentation for session.ts, a typescript file in the drizzle-orm codebase. 13 imports, 1 dependents.

File typescript DrizzleORM DatabaseDrivers 13 imports 1 dependents 3 classes

Entity Profile

Dependency Diagram

graph LR
  e8d52f5f_2316_1b4f_9799_7155b57c23ff["session.ts"]
  70aad088_e19b_50e8_495f_75e687b514dc["index.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> 70aad088_e19b_50e8_495f_75e687b514dc
  739fa900_37e2_e937_8175_429f4f1d4101["getValueFromDataApi"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> 739fa900_37e2_e937_8175_429f4f1d4101
  16976e3f_1e84_95cc_287d_48a3e730c2ee["toValueParam"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> 16976e3f_1e84_95cc_287d_48a3e730c2ee
  c1888528_22f2_78cd_a2b9_80fc9f29b8f3["client-rds-data"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> c1888528_22f2_78cd_a2b9_80fc9f29b8f3
  4509cca4_7fd9_2ecd_1b7c_1ef1c0ee30c4["cache.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> 4509cca4_7fd9_2ecd_1b7c_1ef1c0ee30c4
  47a9c453_10f1_a759_6246_695fcce2b20a["types.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> 47a9c453_10f1_a759_6246_695fcce2b20a
  27705a9d_afe9_57dd_8c97_e52d8a67d426["entity.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> 27705a9d_afe9_57dd_8c97_e52d8a67d426
  220c512d_350b_24bf_2142_53ec35a980ac["logger.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> 220c512d_350b_24bf_2142_53ec35a980ac
  fa14e9c0_b73d_4bcb_463b_adf18df8a285["index.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> fa14e9c0_b73d_4bcb_463b_adf18df8a285
  79ece9bc_4c30_3a6b_c173_2b7b1842a99b["select.types.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> 79ece9bc_4c30_3a6b_c173_2b7b1842a99b
  e4d6a0ab_9aa2_13a6_a2f1_58d94314c3f2["relations.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> e4d6a0ab_9aa2_13a6_a2f1_58d94314c3f2
  be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd["sql.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> be483a7f_d5d7_7a9b_9a13_44a4a6aafbbd
  ecce3253_1e75_a87f_27b3_ca87e81a3024["utils.ts"]
  e8d52f5f_2316_1b4f_9799_7155b57c23ff --> ecce3253_1e75_a87f_27b3_ca87e81a3024
  d4882ed1_0e96_6210_f61b_425eb48edf20["driver.ts"]
  d4882ed1_0e96_6210_f61b_425eb48edf20 --> e8d52f5f_2316_1b4f_9799_7155b57c23ff
  style e8d52f5f_2316_1b4f_9799_7155b57c23ff fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import type { ColumnMetadata, ExecuteStatementCommandOutput, Field, RDSDataClient } from '@aws-sdk/client-rds-data';
import {
	BeginTransactionCommand,
	CommitTransactionCommand,
	ExecuteStatementCommand,
	RollbackTransactionCommand,
} from '@aws-sdk/client-rds-data';
import type { Cache } from '~/cache/core/cache.ts';
import { NoopCache } from '~/cache/core/cache.ts';
import type { WithCacheConfig } from '~/cache/core/types.ts';
import { entityKind } from '~/entity.ts';
import type { Logger } from '~/logger.ts';
import {
	type PgDialect,
	PgPreparedQuery,
	type PgQueryResultHKT,
	PgSession,
	PgTransaction,
	type PgTransactionConfig,
	type PreparedQueryConfig,
} from '~/pg-core/index.ts';
import type { SelectedFieldsOrdered } from '~/pg-core/query-builders/select.types.ts';
import type { RelationalSchemaConfig, TablesRelationalConfig } from '~/relations.ts';
import { fillPlaceholders, type QueryTypingsValue, type QueryWithTypings, type SQL, sql } from '~/sql/sql.ts';
import { mapResultRow } from '~/utils.ts';
import { getValueFromDataApi, toValueParam } from '../common/index.ts';

export type AwsDataApiClient = RDSDataClient;

export class AwsDataApiPreparedQuery<
	T extends PreparedQueryConfig & { values: AwsDataApiPgQueryResult<unknown[]> },
> extends PgPreparedQuery<T> {
	static override readonly [entityKind]: string = 'AwsDataApiPreparedQuery';

	private rawQuery: ExecuteStatementCommand;

	constructor(
		private client: AwsDataApiClient,
		private queryString: string,
		private params: unknown[],
		private typings: QueryTypingsValue[],
		private options: AwsDataApiSessionOptions,
		cache: Cache,
		queryMetadata: {
			type: 'select' | 'update' | 'delete' | 'insert';
			tables: string[];
		} | undefined,
		cacheConfig: WithCacheConfig | undefined,
		private fields: SelectedFieldsOrdered | undefined,
		/** @internal */
		readonly transactionId: string | undefined,
		private _isResponseInArrayMode: boolean,
		private customResultMapper?: (rows: unknown[][]) => T['execute'],
	) {
		super({ sql: queryString, params }, cache, queryMetadata, cacheConfig);
		this.rawQuery = new ExecuteStatementCommand({
			sql: queryString,
			parameters: [],
			secretArn: options.secretArn,
			resourceArn: options.resourceArn,
// ... (232 more lines)

Domain

Subdomains

Dependencies

Frequently Asked Questions

What does session.ts do?
session.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, DatabaseDrivers subdomain.
What does session.ts depend on?
session.ts imports 13 module(s): cache.ts, client-rds-data, entity.ts, getValueFromDataApi, index.ts, index.ts, logger.ts, relations.ts, and 5 more.
What files import session.ts?
session.ts is imported by 1 file(s): driver.ts.
Where is session.ts in the architecture?
session.ts is located at drizzle-orm/src/aws-data-api/pg/session.ts (domain: DrizzleORM, subdomain: DatabaseDrivers, directory: drizzle-orm/src/aws-data-api/pg).

Analyze Your Own Codebase

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

Try Supermodel Free