chore: add server/db.ts

This commit is contained in:
notshop 2026-04-26 16:36:16 +00:00
parent 0382d22c97
commit 3812bbe6ae

11
server/db.ts Normal file
View 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 };