Files
Avtex/scripts/list_users.cjs
T

11 lines
339 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, role FROM "User"');
console.log(JSON.stringify(res.rows, null, 2));
await pool.end();
}
run().catch(console.error);