import { pgQuery, getPgPool } from '../lib/postgres/client';

async function main() {
  const result = await pgQuery<{ now: string }>('SELECT NOW()::text AS now');
  console.log('PostgreSQL connection OK:', result.rows[0]?.now || 'unknown');
}

main()
  .catch((error) => {
    console.error('PostgreSQL connection failed:', error);
    process.exitCode = 1;
  })
  .finally(async () => {
    await getPgPool().end();
  });
