1import { drizzle } from "drizzle-orm/postgres-js";
2import postgres from "postgres";
3
4if (!process.env.DATABASE_URL) {
5 throw new Error("DATABASE_URL is not set");
6}
7const connectionString = process.env.DATABASE_URL;
8
9// Disable prefetch as it is not supported for "Transaction" pool mode
10const client = postgres(connectionString, { prepare: false });
11
12import * as schema from "@/db/schema";
13export const db = drizzle(client, { schema });