chore: add server/db.ts
This commit is contained in:
parent
0382d22c97
commit
3812bbe6ae
1 changed files with 11 additions and 0 deletions
11
server/db.ts
Normal file
11
server/db.ts
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
import { drizzle } from "drizzle-orm/node-postgres";
|
||||||
|
import { Pool } from "pg";
|
||||||
|
import * as schema from "../shared/schema";
|
||||||
|
|
||||||
|
if (!process.env.DATABASE_URL) {
|
||||||
|
throw new Error("DATABASE_URL environment variable is required");
|
||||||
|
}
|
||||||
|
|
||||||
|
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
|
||||||
|
export const db = drizzle(pool, { schema });
|
||||||
|
export { pool };
|
||||||
Loading…
Add table
Reference in a new issue