MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / createDrizzleClient

Function createDrizzleClient

packages/db/src/client.ts:19–35  ·  view source on GitHub ↗
(options: CreateDrizzleClientOptions)

Source from the content-addressed store, hash-verified

17export type DrizzleClient = ReturnType<typeof createDrizzleClient>;
18
19export function createDrizzleClient(options: CreateDrizzleClientOptions) {
20 const { connectionString, poolConfig = {}, logger = false, ssl } = options;
21
22 const baseConfig = getDatabaseClientConfig(connectionString);
23 if (ssl !== undefined) {
24 baseConfig.ssl = ssl;
25 }
26
27 const pool = new pg.Pool({
28 ...baseConfig,
29 ...poolConfig,
30 });
31
32 const db = drizzle(pool, { schema, logger });
33
34 return { db, pool, schema };
35}
36
37export type GetWorkerDbOptions = Omit<pg.PoolConfig, 'connectionString' | 'max'>;
38

Calls 1

getDatabaseClientConfigFunction · 0.90

Tested by 1

seedFakeUserFunction · 0.72