(url: string, env: string)
| 16 | } |
| 17 | |
| 18 | export const connectDB = (url: string, env: string) => { |
| 19 | if (env === "development") { |
| 20 | neonConfig.wsProxy = (host) => `${host}:5433/v1` |
| 21 | neonConfig.useSecureWebSocket = false |
| 22 | neonConfig.pipelineTLS = false |
| 23 | neonConfig.pipelineConnect = false |
| 24 | } |
| 25 | |
| 26 | const pool = new Pool({ connectionString: url, ssl: true }) |
| 27 | return drizzle(pool, { schema }) |
| 28 | } |