bwsamern-ohne_standortplaner/backend/test_insert.js

24 lines
773 B
JavaScript

const { Client } = require('pg');
async function check() {
const client = new Client({
host: '87.106.21.21',
port: 5432,
user: 'enwelo_admin',
password: 'WX1t1cgP1qK09',
database: 'enwelo'
});
try {
await client.connect();
const res = await client.query("INSERT INTO geodaten.wea_standorte (projekt_id, wea_nummer, anlagentyp, nabenhoehe, rotordurchmesser, geom) VALUES ($1, $2, $3, $4, $5, ST_Transform(ST_SetSRID(ST_MakePoint($6, $7), 4326), 25832)) RETURNING id",
['BWSamern-Ohne', 'TEST-2', 'Vestas', 160, 160, 7.3, 52.3]);
console.log('Inserted ID:', res.rows[0].id);
} catch (e) {
console.error(e);
} finally {
await client.end();
}
}
check();