mirror of
https://github.com/knex/knex.git
synced 2025-12-29 07:59:31 +00:00
version assignment on base class, copy on tx client, fix #2705
This commit is contained in:
parent
e08c14b7b1
commit
b20a7ad45d
@ -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();
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user