mirror of
https://github.com/jakejarvis/hoot.git
synced 2025-10-18 20:14:25 -04:00
13 lines
451 B
TypeScript
13 lines
451 B
TypeScript
import { Pool } from "@neondatabase/serverless";
|
|
import { drizzle } from "drizzle-orm/neon-serverless";
|
|
import * as schema from "@/server/db/schema";
|
|
|
|
const connectionString = process.env.DATABASE_URL;
|
|
if (!connectionString) {
|
|
// Throw at import time so we fail fast on misconfiguration in server-only context
|
|
throw new Error("DATABASE_URL is not set");
|
|
}
|
|
|
|
const pool = new Pool({ connectionString });
|
|
export const db = drizzle(pool, { schema });
|