const getUsers = async () => {
await pool.query('select * from users', (err, result) => {
if (err) {
console.log(err);
}
return result.rows;
});
}
const data = getUsers();
console.log(data);
let data = [];
getUsers().then((result) => {
data = result;
console.log(data);
});