feat: move database initialization to get_connection.ts

This commit is contained in:
2024-09-03 09:06:51 +09:00
parent 0398b95c24
commit 4c87679fbe
2 changed files with 4 additions and 5 deletions
@@ -13,3 +13,7 @@ const connectionString = `postgres://${PG_USER}:${PG_PASS}@${PG_HOST}:${PG_PORT}
const pool = new Pool({ connectionString });
export const getConnection = () => pool;
import init from '$lib/server/database/init_db';
import PG from '$lib/server/database';
await init(await PG(pool));