11 lines
342 B
TypeScript
11 lines
342 B
TypeScript
|
|
import { drizzle } from 'drizzle-orm/postgres-js'
|
||
|
|
import postgres from 'postgres'
|
||
|
|
import * as schema from './schema'
|
||
|
|
|
||
|
|
const connectionString = process.env.DATABASE_URL ?? 'postgres://wc:wc@localhost:5432/worldcup'
|
||
|
|
|
||
|
|
const client = postgres(connectionString, { max: 10 })
|
||
|
|
export const db = drizzle(client, { schema })
|
||
|
|
|
||
|
|
export * from './schema'
|