Created
January 23, 2012 15:40
-
-
Save brianc/1663864 to your computer and use it in GitHub Desktop.
monkey-patch node-postgres to log queries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Query = require('pg').Query; | |
var actualSubmit = Query.prototype.submit; | |
Query.prototype.submit = function() { | |
console.log(this.text); | |
actualSubmit.apply(this, arguments); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about this ? This actually logs the final query.