bwsamern-ohne_standortplaner/backend/check_sample_data.js

26 lines
650 B
JavaScript

const { Client } = require('pg');
async function check() {
require('dotenv').config({ path: '../.env' });
const client = new Client({
host: process.env.DB_HOST,
port: process.env.DB_PORT,
user: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME
});
try {
await client.connect();
const res = await client.query(`
SELECT * FROM geodaten.flaecheneigentuemer_alkis LIMIT 5;
`);
console.log(JSON.stringify(res.rows, null, 2));
} catch (e) {
console.error("Error:", e);
} finally {
await client.end();
}
}
check();