23 lines
813 B
JavaScript
23 lines
813 B
JavaScript
const { Client } = require('pg');
|
|
const client = new Client({
|
|
host: '87.106.21.21',
|
|
port: 5432,
|
|
user: 'enwelo_admin',
|
|
password: 'WX1t1cgP1qK09',
|
|
database: 'enwelo'
|
|
});
|
|
client.connect().then(async () => {
|
|
try {
|
|
const res = await client.query('SELECT count(*) FROM geodaten.flaecheneigentuemer_status WHERE projekt_id = \'5bb4e049-85f2-4433-b38e-6a66b81e9f06\'');
|
|
console.log('Status count for bw_samern-ohne: ' + res.rows[0].count);
|
|
|
|
const sample = await client.query('SELECT * FROM geodaten.flaecheneigentuemer_status WHERE projekt_id = \'5bb4e049-85f2-4433-b38e-6a66b81e9f06\' LIMIT 5');
|
|
console.log('Sample entries:');
|
|
console.table(sample.rows);
|
|
} catch (e) {
|
|
console.error(e);
|
|
} finally {
|
|
client.end();
|
|
}
|
|
});
|