stagingbackend / src /db /test-connection.js
Antaram's picture
Upload 18 files
9eab1a6 verified
raw
history blame contribute delete
510 Bytes
const pool = require('./config');
async function testConnection() {
try {
const client = await pool.connect();
console.log('βœ… Successfully connected to the database!');
const res = await client.query('SELECT VERSION()');
console.log('πŸ“Š Database Version:', res.rows[0].version);
client.release();
} catch (err) {
console.error('❌ Connection failed:', err);
} finally {
await pool.end();
}
}
testConnection();