const { Client } = require('pg'); const client = new Client({ user: 'admin', host: 'localhost', database: 'sop_monitoring', password: 'password', port: 5432 }); client.connect().then(() => client.query("SELECT * FROM events WHERE camera_zone = 'Conveyor' ORDER BY start_time ASC")) .then(res => { console.log(res.rows); client.end(); }).catch(console.error);