mirror of
https://github.com/knex/knex.git
synced 2025-12-30 00:30:14 +00:00
Fix #434, add returning config option
This commit is contained in:
parent
cd4864e740
commit
83b2c2b078
@ -13,6 +13,7 @@ var pg;
|
||||
// 'lib/query/compiler', respectively.
|
||||
function Client_PG(config) {
|
||||
Client.apply(this, arguments);
|
||||
if (config.returning) this.defaultReturning = config.returning;
|
||||
if (config.debug) this.isDebugging = true;
|
||||
if (config.connection) {
|
||||
this.initDriver();
|
||||
|
||||
@ -14,6 +14,9 @@ var QueryCompiler = require('../../query/compiler');
|
||||
function QueryBuilder_PG() {
|
||||
this.client = client;
|
||||
QueryBuilder.apply(this, arguments);
|
||||
if (client.defaultReturning) {
|
||||
this._single.returning = client.defaultReturning;
|
||||
}
|
||||
}
|
||||
inherits(QueryBuilder_PG, QueryBuilder);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user