feat: Update pg type
This commit is contained in:
parent
cdec7e78b7
commit
5c01942948
|
@ -1,10 +1,9 @@
|
||||||
import pg from 'pg';
|
import pg from 'pg';
|
||||||
const { Pool } = pg;
|
|
||||||
import { getConnection } from './database/get_connection';
|
import { getConnection } from './database/get_connection';
|
||||||
|
|
||||||
export class Postgres {
|
export class Postgres {
|
||||||
client: pg.PoolClient | null = null;
|
client: pg.PoolClient | null = null;
|
||||||
public static async new(pool: Pool) {
|
public static async new(pool: pg.Pool) {
|
||||||
const pg = new Postgres();
|
const pg = new Postgres();
|
||||||
pg.client = await getConnection().connect();
|
pg.client = await getConnection().connect();
|
||||||
return pg;
|
return pg;
|
||||||
|
@ -32,7 +31,7 @@ export class Postgres {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default async (
|
export default async (
|
||||||
pool: Pool
|
pool: pg.Pool
|
||||||
) => { return await Postgres.new(pool); };
|
) => { return await Postgres.new(pool); };
|
||||||
|
|
||||||
import { building } from '$app/environment';
|
import { building } from '$app/environment';
|
||||||
|
|
Loading…
Reference in New Issue
Block a user