Files
trackevery-day/lib/db/index.ts
Felix Schulze 5bb861d881
All checks were successful
Lint / Lint and Check (push) Successful in 41s
env config
2025-11-15 17:23:10 +01:00

14 lines
378 B
TypeScript

import { drizzle } from 'drizzle-orm/node-postgres';
import * as schema from './schema';
import '@/lib/env-config';
const DATABASE_URL = process.env.POSTGRES_URL;
if (!DATABASE_URL) {
throw new Error('POSTGRES_URL environment variable is required');
}
export const db = drizzle(DATABASE_URL, { schema });
// Re-export schema types for convenience
export * from './schema';