mirror of
https://github.com/knex/knex.git
synced 2026-01-04 11:08:23 +00:00
Merge pull request #335 from wbyoung/debug-flag
Allow debug flag to be a function.
This commit is contained in:
commit
712786bf95
@ -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);
|
||||
});
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user