Spaces:
Sleeping
Sleeping
File size: 510 Bytes
9eab1a6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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();
|