(dbName: string)
| 82 | }); |
| 83 | |
| 84 | async 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 | } |
no test coverage detected