Standortplaner/check_db.js

25 lines
621 B
JavaScript

const { Pool } = require('pg');
const pool = new Pool({
host: '87.106.21.21',
port: 5432,
database: 'enwelo',
user: 'enwelo_admin',
password: 'WX1t1cgP1qK09'
});
async function checkTable() {
try {
const resCount = await pool.query("SELECT COUNT(*) FROM geodaten.wohngebaeude_umrisse;");
console.log("Count:", resCount.rows[0].count);
const resIdx = await pool.query("SELECT indexname, indexdef FROM pg_indexes WHERE tablename = 'wohngebaeude_umrisse';");
console.log("Indexes:", resIdx.rows);
} catch (err) {
console.error(err);
} finally {
pool.end();
}
}
checkTable();