Sunday 21 May 2017

Get executed SQL statement from pgPromise query result

I'm writing an API that does queries over multiple postgres databases using node and pg-promise.

I'm interested in getting the executed SQL statement from query result. Something like pg-monitor outputs to console. I've set up pg-monitor and noticed there is a setLog method which I can use to get the data I need, but it would be perfect if I could get the same data from the place I'm executing the query from.

Point of this would be to enable the API to return both the query results and the metadata like the executed SQL. Is this possible? Thanks!



via Ivan Ković

No comments:

Post a Comment