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