不要怂,就是干,撸起袖子干!

Commit a22ea8ec by Meg Sharkey

added sql logging

1 parent 5b2bbf4f
Showing with 3 additions and 0 deletions
......@@ -25,6 +25,9 @@ module.exports = (function() {
, isUpdateCommand = (self.sql.toLowerCase().indexOf('update') == 0)
, databaseMethod = (isInsertCommand || isUpdateCommand) ? 'run' : 'all'
//allow clients to listen to sql to do their own logging or whatnot
self.emit('sql', self.sql)
self.database[databaseMethod](self.sql, function(err, results) {
err ? onFailure.call(self, err) : onSuccess.call(self, results, this)
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!