require('dotenv').config();
const postgres = require('postgres');

const sql = postgres({
  host: process.env.DB_HOST || '87.106.21.21',
  port: process.env.DB_PORT || 5432,
  database: process.env.DB_NAME || 'enwelo',
  username: process.env.DB_USER || 'postgres',
  password: process.env.DB_PASSWORD || ''
});

async function run() {
  try {
    const res = await sql`
      SELECT column_name, data_type 
      FROM information_schema.columns 
      WHERE table_schema = 'geodaten' AND table_name = 'wea';
    `;
    console.log(res);
  } catch (err) {
    console.error(err);
  } finally {
    await sql.end();
  }
}

run();
