From d985a35cb17b70e5114dac7eecd570c04860f767 Mon Sep 17 00:00:00 2001 From: Fahad Faruqi Date: Mon, 3 Jun 2024 12:55:11 -0400 Subject: [PATCH] added logging --- db.config.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/db.config.ts b/db.config.ts index 96c7940..4dd8373 100644 --- a/db.config.ts +++ b/db.config.ts @@ -10,4 +10,7 @@ const client = new Client({ port: process.env.POSTGRESQL_DB_PORT ? parseInt(process.env.POSTGRESQL_DB_PORT) : 5432 }); +client.on('end', () => console.log('Client has disconnected')); +client.on('error', (err) => console.error('Unexpected error on idle client', err)); + export default client;