21 lines
549 B
JavaScript
21 lines
549 B
JavaScript
const { Client } = require('pg');
|
|
|
|
const client = new Client({
|
|
user: 'dtic_user',
|
|
host: '127.0.0.1',
|
|
database: 'dtic_bitacoras',
|
|
password: 'dtic_pass_2026',
|
|
port: 5433,
|
|
});
|
|
|
|
async function run() {
|
|
await client.connect();
|
|
console.log("Connected to DB");
|
|
|
|
const hitos = await client.query("SELECT f.numero as fase, h.id_hito, h.titulo FROM bitacoras.hitos h JOIN bitacoras.fases f ON h.fase_id = f.id ORDER BY f.numero, h.id_hito");
|
|
console.table(hitos.rows);
|
|
|
|
await client.end();
|
|
}
|
|
run().catch(console.error);
|