mirror of
https://github.com/simstudioai/sim.git
synced 2026-04-06 03:00:16 -04:00
13 lines
436 B
TypeScript
13 lines
436 B
TypeScript
import { drizzle } from 'drizzle-orm/postgres-js'
|
|
import postgres from 'postgres'
|
|
|
|
// In production, use the Vercel-generated POSTGRES_URL
|
|
// In development, use the direct DATABASE_URL
|
|
const connectionString = process.env.POSTGRES_URL || process.env.DATABASE_URL!
|
|
|
|
// Disable prefetch as it is not supported for "Transaction" pool mode
|
|
const client = postgres(connectionString, {
|
|
prepare: false,
|
|
})
|
|
export const db = drizzle(client)
|