better-chatbot / src /lib /db /pg /db.pg.ts
Bot
Cap database connection pool size at 3 to respect Aiven connections ceiling
8f7768e
Raw
History Blame Contribute Delete
295 Bytes
import { drizzle as drizzlePg } from "drizzle-orm/node-postgres";
import { Pool } from "pg";
const pool = new Pool({
connectionString: process.env.POSTGRES_URL,
ssl: { rejectUnauthorized: false },
max: 3,
idleTimeoutMillis: 300000,
});
export const pgDb = drizzlePg({ client: pool });