11 lines
333 B
JavaScript
11 lines
333 B
JavaScript
const { Pool } = require('pg');
|
|
|
|
async function run() {
|
|
const pool = new Pool({ connectionString: 'postgresql://postgres:postgres@localhost:5432/xflow' });
|
|
const res = await pool.query('SELECT id, username, email FROM "User"');
|
|
console.log(JSON.stringify(res.rows, null, 2));
|
|
await pool.end();
|
|
}
|
|
|
|
run().catch(console.error);
|