pg-proxy.test.ts — drizzle-orm Source File
Architecture documentation for pg-proxy.test.ts, a typescript file in the drizzle-orm codebase. 15 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR f1e8cfe5_698a_f227_ec0b_55d2af2a5373["pg-proxy.test.ts"] d133ab06_e39e_bce4_90ee_a55144ce75c2["pg-common.ts"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> d133ab06_e39e_bce4_90ee_a55144ce75c2 a90d4692_a295_76b3_2a7a_9924864203ad["createDockerDB"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> a90d4692_a295_76b3_2a7a_9924864203ad d4e96821_5055_cb66_dd7b_f89dd0f8d0a0["tests"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> d4e96821_5055_cb66_dd7b_f89dd0f8d0a0 7b6fdfe3_d9a8_26c3_430d_2261b1d7aadb["pg-common-cache.ts"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> 7b6fdfe3_d9a8_26c3_430d_2261b1d7aadb 76da0078_4d8f_9615_8689_c44d597d58dc["TestCache"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> 76da0078_4d8f_9615_8689_c44d597d58dc d43d88d6_c6b6_386d_d59b_76b8db53bf29["TestGlobalCache"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> d43d88d6_c6b6_386d_d59b_76b8db53bf29 a69d8fa0_a523_c055_3559_0193c74ef267["tests"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> a69d8fa0_a523_c055_3559_0193c74ef267 cad5819d_2851_9c06_9778_62eb6e1b2dab["async-retry"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> cad5819d_2851_9c06_9778_62eb6e1b2dab 690f7dfc_0aea_9ee8_d6e7_26bbb3689031["drizzle-orm"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> 690f7dfc_0aea_9ee8_d6e7_26bbb3689031 53497908_16e7_977d_e97d_7414884a88a6["pg-core"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> 53497908_16e7_977d_e97d_7414884a88a6 9871f1ad_c800_eff6_83e2_4d6aefb827ff["pg-proxy"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> 9871f1ad_c800_eff6_83e2_4d6aefb827ff 990b01de_24f9_f6e8_0c7b_f90451ab86c1["migrator"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> 990b01de_24f9_f6e8_0c7b_f90451ab86c1 0d277acf_0d68_9daf_8724_642232a89719["pg"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> 0d277acf_0d68_9daf_8724_642232a89719 8d35eaf2_a542_cfd4_fa1a_fafca0f02686["vitest"] f1e8cfe5_698a_f227_ec0b_55d2af2a5373 --> 8d35eaf2_a542_cfd4_fa1a_fafca0f02686 style f1e8cfe5_698a_f227_ec0b_55d2af2a5373 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import retry from 'async-retry';
import { sql } from 'drizzle-orm';
import { pgTable, serial, timestamp } from 'drizzle-orm/pg-core';
import type { PgRemoteDatabase } from 'drizzle-orm/pg-proxy';
import { drizzle as proxyDrizzle } from 'drizzle-orm/pg-proxy';
import { migrate } from 'drizzle-orm/pg-proxy/migrator';
import * as pg from 'pg';
import { afterAll, beforeAll, beforeEach, expect, test } from 'vitest';
import { skipTests } from '~/common';
import { createDockerDB, tests, usersMigratorTable, usersTable } from './pg-common';
import { TestCache, TestGlobalCache, tests as cacheTests } from './pg-common-cache';
// eslint-disable-next-line drizzle-internal/require-entity-kind
class ServerSimulator {
constructor(private db: pg.Client) {
const { types } = pg;
types.setTypeParser(types.builtins.TIMESTAMPTZ, (val) => val);
types.setTypeParser(types.builtins.TIMESTAMP, (val) => val);
types.setTypeParser(types.builtins.DATE, (val) => val);
types.setTypeParser(types.builtins.INTERVAL, (val) => val);
types.setTypeParser(1231, (val) => val);
types.setTypeParser(1115, (val) => val);
types.setTypeParser(1185, (val) => val);
types.setTypeParser(1187, (val) => val);
types.setTypeParser(1182, (val) => val);
}
async query(sql: string, params: any[], method: 'all' | 'execute') {
if (method === 'all') {
try {
const result = await this.db.query({
text: sql,
values: params,
rowMode: 'array',
});
return { data: result.rows as any };
} catch (e: any) {
return { error: e };
}
} else if (method === 'execute') {
try {
const result = await this.db.query({
text: sql,
values: params,
});
return { data: result.rows as any };
} catch (e: any) {
return { error: e };
}
} else {
return { error: 'Unknown method value' };
}
}
async migrations(queries: string[]) {
await this.db.query('BEGIN');
try {
// ... (453 more lines)
Domain
Subdomains
Classes
Dependencies
- TestCache
- TestGlobalCache
- async-retry
- common
- createDockerDB
- drizzle-orm
- migrator
- pg
- pg-common-cache.ts
- pg-common.ts
- pg-core
- pg-proxy
- tests
- tests
- vitest
Source
Frequently Asked Questions
What does pg-proxy.test.ts do?
pg-proxy.test.ts is a source file in the drizzle-orm codebase, written in typescript. It belongs to the DrizzleORM domain, DatabaseDrivers subdomain.
What does pg-proxy.test.ts depend on?
pg-proxy.test.ts imports 15 module(s): TestCache, TestGlobalCache, async-retry, common, createDockerDB, drizzle-orm, migrator, pg, and 7 more.
Where is pg-proxy.test.ts in the architecture?
pg-proxy.test.ts is located at integration-tests/tests/pg/pg-proxy.test.ts (domain: DrizzleORM, subdomain: DatabaseDrivers, directory: integration-tests/tests/pg).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free