Skip to content

Commit

Permalink
Merge pull request #335 from wbyoung/debug-flag
Browse files Browse the repository at this point in the history
Allow debug flag to be a function.
  • Loading branch information
tgriesser committed Jun 22, 2014
2 parents 7645804 + c957e7b commit 712786b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ Runner.prototype.run = Promise.method(function() {
.then(this.ensureConnection)
.then(function(connection) {
this.connection = connection;
this.client.emit('start', this.builder);
this.builder.emit('start');
var sql = this.builder.toSQL();
if (_.isArray(sql)) {
return this.queryArray(sql);
}
return this.query(sql);
})
.tap(function() {
this.builder.emit('end');
})
.finally(this.cleanupConnection);
});

Expand Down

0 comments on commit 712786b

Please sign in to comment.