Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processor being cached for each connection instead recreate #240

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions lib/adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ module.exports = (function() {
// Store the connection
connections[connection.identity] = {
config: connection,
collections: collections,
schema: schema,
version: version
version: version,
processor: new Processor(schema) // Cache processor for each connection to avoid deepClone of schema
};

// Always call describe
Expand Down Expand Up @@ -517,7 +519,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] || {};
Expand Down Expand Up @@ -608,7 +610,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] || {};
Expand Down Expand Up @@ -1080,7 +1082,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] || {};
Expand Down Expand Up @@ -1143,7 +1145,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] || {};
Expand Down Expand Up @@ -1258,7 +1260,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] || {};
Expand Down