version assignment on base class, copy on tx client, fix #2705

This commit is contained in:
Tim Griesser 2018-07-11 13:01:43 -04:00
parent e08c14b7b1
commit b20a7ad45d
3 changed files with 5 additions and 4 deletions

View File

@ -42,6 +42,10 @@ function Client(config = {}) {
throw new Error(`knex: Required configuration option 'client' is missing.`);
}
if (config.version) {
this.version = config.version;
}
this.connectionSettings = cloneDeep(config.connection || {});
if (this.driverName && config.connection) {
this.initializeDriver();

View File

@ -20,10 +20,6 @@ function Client_PG(config) {
if (config.searchPath) {
this.searchPath = config.searchPath;
}
if (config.version) {
this.version = config.version;
}
}
inherits(Client_PG, Client);

View File

@ -209,6 +209,7 @@ function makeTransactor(trx, connection, trxClient) {
// connection and does not release back into the pool.
function makeTxClient(trx, client, connection) {
const trxClient = Object.create(client.constructor.prototype);
trxClient.version = client.version;
trxClient.config = client.config;
trxClient.driver = client.driver;
trxClient.connectionSettings = client.connectionSettings;