14 lines
423 B
TypeScript
14 lines
423 B
TypeScript
import { drizzle } from 'drizzle-orm/postgres-js';
|
|
import postgres from 'postgres';
|
|
import * as schema from '@banatie/database';
|
|
|
|
const connectionString =
|
|
process.env.DATABASE_URL ||
|
|
'postgresql://banatie_user:banatie_secure_password@localhost:5434/banatie_db';
|
|
|
|
// Create postgres client
|
|
const client = postgres(connectionString);
|
|
|
|
// Create drizzle instance with schema
|
|
export const db = drizzle(client, { schema });
|