fix for type script

This commit is contained in:
Jun-te Kim 2026-01-18 19:33:43 +00:00
parent b70fa27725
commit 939e91b52c

View file

@ -1,8 +1,7 @@
// lib/db.ts
import { drizzle } from "drizzle-orm/node-postgres"; import { drizzle } from "drizzle-orm/node-postgres";
import { Pool } from "pg"; import { Pool } from "pg";
import * as schema from "./schema";
// Fail fast if env is missing
if (!process.env.DATABASE_URL) { if (!process.env.DATABASE_URL) {
throw new Error("DATABASE_URL is not set"); throw new Error("DATABASE_URL is not set");
} }
@ -15,5 +14,4 @@ const pool = new Pool({
: false, : false,
}); });
// Export a single db instance export const db = drizzle(pool, { schema });
export const db = drizzle(pool);