import { Pool } from 'pg'; const pool = new Pool({ connectionString: process.env.DATABASE_URL || 'postgresql://localhost:5432/taskflow', max: 20, idleTimeoutMillis: 30000, }); export async function query(sql: string, params?: any[]) { const client = await pool.connect(); try { return await client.query(sql, params); } finally { client.release(); } } export async function healthCheck(): Promise { try { await query('SELECT 1'); return true; } catch { return false; } } export { pool };