Here is the code that I have tried.client.release() or client.end() is giving me UnhandledPromiseRejectionWarning .I would want to release the connection back to the pool or end it once data is inserted.
client.query(format(query, values), (err, res) => {
if (err) {
console.error(err, res);
client.release();
} else {
console.log('POSTGRES DATA INSERTED SUCCESSFULLY');
// client.end();
client.release();
}
});
from Not able to release postgres client using npm-postgres
No comments:
Post a Comment