()
| 5 | import { buildPostgresSsl } from "../../lib/postgres/connection"; |
| 6 | import * as schema from "./schema"; |
| 7 | |
| 8 | const client = postgres(env.DATABASE_URL, { |
| 9 | max: env.DATABASE_POOL_SIZE, |
| 10 | idle_timeout: 20, |
| 11 | connect_timeout: env.isTest ? 1 : 10, |
| 12 | max_lifetime: 60 * 30, |
| 13 | prepare: true, |
| 14 | ssl: buildPostgresSsl({ |
| 15 | isProduction: env.isProduction, |
| 16 | rejectUnauthorized: env.DATABASE_SSL_REJECT_UNAUTHORIZED, |
| 17 | ca: env.DATABASE_SSL_CA, |
| 18 | }), |
| 19 | onnotice: (notice) => { |
| 20 | if (!env.isDevelopment) { |
| 21 | return; |