js and Postgres (using this module) and I would like to view the SQL that has been executed after I have queried the database (as I'm using parameterised statements). Is there an easy way to do this?
For example, I execute code as follows:
var first = client.query("UPDATE settings SET json=$1 WHERE source_name=$2", [JSON.stringify(settings), 'website']);
first.on('end', function(result){
console.log(result);
client.end();
});
Is there a method like result.lastQuery()
that I can utilise as I can't find anything like this in the docs? I'm having trouble getting my query to work and I'd like to debug it further.