fix: use hook data to create a new DB instance

This commit is contained in:
Keisuke Hirata 2024-09-02 22:02:19 +09:00
parent 5c01942948
commit 4fb912cbf9

View File

@ -5,7 +5,7 @@ export class Postgres {
client: pg.PoolClient | null = null; client: pg.PoolClient | null = null;
public static async new(pool: pg.Pool) { public static async new(pool: pg.Pool) {
const pg = new Postgres(); const pg = new Postgres();
pg.client = await getConnection().connect(); pg.client = await pool.connect();
return pg; return pg;
} }