From 87f40112ad56ee6d5a7ed6d913fd20ba036c396c Mon Sep 17 00:00:00 2001 From: Nikita Kuhta Date: Fri, 8 Apr 2016 10:57:37 +0300 Subject: [PATCH 1/2] Adapter cache processor for each connection instead recreate --- lib/adapter.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/adapter.js b/lib/adapter.js index f9b31e6..03481e0 100644 --- a/lib/adapter.js +++ b/lib/adapter.js @@ -127,7 +127,8 @@ module.exports = (function() { connections[connection.identity] = { config: connection, collections: collections, - schema: schema + schema: schema, + processor: new Processor(schema) // Cache processor for each connection to avoid deepClone of schema }; // Always call describe @@ -508,7 +509,7 @@ module.exports = (function() { // Build up a SQL Query var schema = connectionObject.schema; - var processor = new Processor(schema); + var processor = connectionObject.processor; // use cached processor // Mixin WL Next connection overrides to sqlOptions var overrides = connectionOverrides[connectionName] || {}; @@ -600,7 +601,7 @@ module.exports = (function() { // Build up a SQL Query var schema = connectionObject.schema; - var processor = new Processor(schema); + var processor = connectionObject.processor; // use cached processor // Mixin WL Next connection overrides to sqlOptions var overrides = connectionOverrides[connectionName] || {}; @@ -1067,7 +1068,7 @@ module.exports = (function() { // Build Query var _schema = connectionObject.schema; - var processor = new Processor(_schema); + var processor = connectionObject.processor; // use cached processor // Mixin WL Next connection overrides to sqlOptions var overrides = connectionOverrides[connectionName] || {}; @@ -1120,7 +1121,7 @@ module.exports = (function() { // Build Query var _schema = connectionObject.schema; - var processor = new Processor(_schema); + var processor = connectionObject.processor; // use cached processor // Mixin WL Next connection overrides to sqlOptions var overrides = connectionOverrides[connectionName] || {}; @@ -1208,7 +1209,7 @@ module.exports = (function() { var tableName = table; var _schema = connectionObject.schema; - var processor = new Processor(_schema); + var processor = connectionObject.processor; // use cached processor // Mixin WL Next connection overrides to sqlOptions var overrides = connectionOverrides[connectionName] || {}; From f80ef78c80e9fb009861d93ac776a320635c9c7e Mon Sep 17 00:00:00 2001 From: Nikita Kuhta Date: Tue, 4 Oct 2016 09:56:46 +0300 Subject: [PATCH 2/2] Conflict resolved --- lib/adapter.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/lib/adapter.js b/lib/adapter.js index a9a9a85..ff284a4 100644 --- a/lib/adapter.js +++ b/lib/adapter.js @@ -140,14 +140,10 @@ module.exports = (function() { // Store the connection connections[connection.identity] = { config: connection, -<<<<<<< HEAD collections: collections, schema: schema, + version: version, processor: new Processor(schema) // Cache processor for each connection to avoid deepClone of schema -======= - schema: schema, - version: version ->>>>>>> f0c92f5d2ca6d654d520034c90a90562e3b5fb6c }; // Always call describe