MCPcopy Create free account
hub / github.com/zenstackhq/zenstack / createClient

Function createClient

tests/runtimes/edge-runtime/edge-runtime-e2e.test.ts:84–101  ·  view source on GitHub ↗
(dbName: string)

Source from the content-addressed store, hash-verified

82});
83
84async function createClient(dbName: string) {
85 const pgClient = new Client({
86 connectionString: TEST_PG_URL,
87 });
88 await pgClient.connect();
89 await pgClient.query(`DROP DATABASE IF EXISTS "${dbName}"`);
90 await pgClient.query(`CREATE DATABASE "${dbName}"`);
91 await pgClient.end();
92 const dialect = new PostgresDialect({
93 pool: new Pool({
94 connectionString: `${TEST_PG_URL}/${dbName}`,
95 }),
96 });
97
98 const db = new ZenStackClient(schema, { dialect });
99 await db.$pushSchema();
100 return db;
101}

Callers 1

Calls 1

$pushSchemaMethod · 0.80

Tested by

no test coverage detected