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

Commit 42706422 by Sascha Depold

Pass the uuid as a second parameter to the sql event

1 parent cfc66e9e
......@@ -24,7 +24,7 @@ module.exports = (function() {
}
this.client.query(this.sql, function(err, results, fields) {
this.emit('sql', this.sql)
this.emit('sql', this.sql, this.options.uuid)
if (err) {
err.sql = sql
......@@ -38,5 +38,3 @@ module.exports = (function() {
return Query
})()
......@@ -38,12 +38,12 @@ module.exports = (function() {
query.on('error', function(err) {
receivedError = true
err.sql = sql
self.emit('sql', sql)
self.emit('sql', sql, self.options.uuid)
self.emit('error', err, self.callee)
})
query.on('end', function(result) {
self.emit('sql', self.sql)
self.emit('sql', self.sql, self.options.uuid)
if (receivedError) {
return
......
......@@ -36,13 +36,13 @@ module.exports = (function() {
if (self.sql.indexOf('-- ') === 0) {
// the sql query starts with a comment. don't bother the server with that ...
Utils.tick(function() {
self.emit('sql', self.sql)
self.emit('sql', self.sql, self.options.uuid)
self.emit('success', null)
})
} else {
self.database[getDatabaseMethod.call(self)](self.sql, function(err, results) {
// allow clients to listen to sql to do their own logging or whatnot
self.emit('sql', self.sql)
self.emit('sql', self.sql, self.options.uuid)
if (err) {
err.sql = self.sql
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!