Files

14 lines
476 B
TypeScript
Raw Permalink Normal View History

import { drizzle } from 'drizzle-orm/postgres-js'
import postgres from 'postgres'
import * as schema from './schema'
// Passwords with special chars (#, ], =) must be percent-encoded in DATABASE_URL.
// postgres.js decodes them correctly (e.g. %23 → #). No separate DB_PASSWORD needed.
const client = postgres(
process.env.DATABASE_URL ?? 'postgres://wc:wc@localhost:5432/worldcup',
{ max: 10 }
)
export const db = drizzle(client, { schema })
export * from './schema'