When we get response back from the db
client.connect(query, params, (err, res) => { if(err) //This should have a field query which will give us the final prepared query that has caused error })
This will be very helpful to debug and to point out whether the issue is with syntax of query or parametrisation or anything else.