const { Client } = require('pg');
const client = new Client({user: 'postgres', host: '127.0.0.1', database: 'car', password: 'visali07', port: 5432});
client.connect()
  .then(() => client.query("SELECT column_name FROM information_schema.columns WHERE table_name = 'bookings'"))
  .then(res => { console.log(res.rows.map(r=>r.column_name)); client.end(); })
  .catch(err => console.error(err));