import pg from "pg"; import { config } from "./config.js"; export const pool = new pg.Pool({ connectionString: config.postgres.connectionString, max: 10, idleTimeoutMillis: 30_000, connectionTimeoutMillis: 5_000, }); /** Quick health check — resolves true if DB responds. */ export async function pgHealthy(): Promise { try { await pool.query("SELECT 1"); return true; } catch { return false; } }