Tuesday, 28 August 2018

Node-postgres question regarding clients

In the FAQs, it says that if you need a one time query, you can simple use pool.query, but what does it mean by "one time"? Is this one time?app.post('/test', async(req, res) => { let result1 = await pool.query(`statement`, [data]) .then(result => { return result; }) .catch(err => console.log(err)); let result2 = await pool.query(`another statement`, [more_data]) then(result => { return result; }) .catch(err => console.log(err)); }); Will the first query release the client back to the pool when it is done?

Submitted August 29, 2018 at 12:50AM by eggtart_prince

No comments:

Post a Comment