Files
2026-08-26 14:21:53 +03:00

16 lines
507 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import postgres from 'postgres'
// DATABASE_URL örneği:
// postgresql://user:password@localhost:5432/configvault
// postgresql://user:password@your-server.com:5432/configvault?sslmode=require
const sql = postgres(process.env.DATABASE_URL!, {
max: 10, // max connection pool size
idle_timeout: 20, // saniye
connect_timeout: 10,
// SSL: production'da genellikle gerekli, lokal'de kapalı
ssl: process.env.DATABASE_SSL === 'true' ? 'require' : false,
})
export default sql