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

Commit 732a7b34 by Sascha Depold

removed error observing of sql client

1 parent 68d5e45f
Showing with 0 additions and 19 deletions
...@@ -20,15 +20,11 @@ module.exports = (function() { ...@@ -20,15 +20,11 @@ module.exports = (function() {
Query.prototype.run = function(sql) { Query.prototype.run = function(sql) {
this.sql = sql this.sql = sql
bindClient.call(this)
if(this.options.logging !== false) { if(this.options.logging !== false) {
this.options.logging('Executing: ' + this.sql) this.options.logging('Executing: ' + this.sql)
} }
this.client.query(this.sql, function(err, results, fields) { this.client.query(this.sql, function(err, results, fields) {
unbindClient.call(this)
this.emit('sql', this.sql) this.emit('sql', this.sql)
if (err) { if (err) {
...@@ -45,20 +41,5 @@ module.exports = (function() { ...@@ -45,20 +41,5 @@ module.exports = (function() {
return this return this
} }
//private
var onClientError = function(err) {
unbindClient.call(this)
this.emit('error', err, this.callee)
}
var bindClient = function() {
this.client.on('error', onClientError.bind(this))
}
var unbindClient = function() {
this.client.removeListener('error', onClientError.bind(this))
}
return Query return Query
})() })()
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!