← back to Designerrepresentatives

lib/db.js

10 lines

const { Pool } = require('pg');

const pool = new Pool({
  // libpq env vars are picked up automatically (PGHOST/PGPORT/PGUSER/PGPASSWORD/PGDATABASE).
  max: parseInt(process.env.PG_POOL_MAX || '10', 10),
  idleTimeoutMillis: 30_000,
});

module.exports = { pool };