leo-connector-common
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -72,5 +72,10 @@ "use strict"; | ||
Object.keys(tables).forEach((table) => { | ||
// @todo handle deletes separatley | ||
if (obj.update && obj.update[table]) { | ||
obj[table] = obj.update[table]; | ||
} | ||
// only process if we have any data for this table | ||
if (obj[table] && obj[table].length) { | ||
if (Array.isArray(tables[table])) { // if we passed in an array of primary keys | ||
@@ -241,9 +246,2 @@ // turn the object into an array of items | ||
/** | ||
* Filter bin logs to pull changed ids for specific tables | ||
* @param params | ||
* @todo | ||
*/ | ||
this.filterBinLogs = function (params) {}; | ||
/** | ||
* Create a change stream and get changed ids for specific tables | ||
@@ -273,3 +271,4 @@ * @param params { | ||
let queue = refUtil.ref(event.source); | ||
let start = params.start | ||
params.source = event.source; | ||
params.start = params.start | ||
|| event.start | ||
@@ -281,3 +280,3 @@ || (event.__cron | ||
|| (event.__cron.checkpoints.read[queue.id] && event.__cron.checkpoints.read[queue.id].checkpoint))) | ||
|| '0.0'; | ||
|| params.defaultCheckpoint || '0.0'; | ||
@@ -290,6 +289,3 @@ return { | ||
run: function(callback) { | ||
let stream = params.connector.streamChanges(params.connection, trackedTables, { | ||
start: start, | ||
source: event.source | ||
}); | ||
let stream = params.connector.streamChanges(params.connection, trackedTables, params); | ||
@@ -304,3 +300,2 @@ let end; | ||
params.ls.pipe(stream, | ||
// ls.log(), | ||
end, (err) => { | ||
@@ -307,0 +302,0 @@ console.log("all done"); |
{ | ||
"name": "leo-connector-common", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Common package for all Leo Platform database connectors", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -58,3 +58,4 @@ "use strict"; | ||
source: "loader", | ||
isSnapshot: false | ||
isSnapshot: false, | ||
values: true | ||
}) { | ||
@@ -67,3 +68,3 @@ let ids = []; | ||
buildEntities({ | ||
jointable: 'values ' + buildIds.map(keys => { | ||
jointable: (opts.values ? 'values ' : '') + buildIds.map(keys => { | ||
return "(" + keys.join(",") + ")"; | ||
@@ -192,2 +193,3 @@ }).join(","), | ||
} = domainIdentifierFor(row, obj.id); | ||
if (!err) { | ||
@@ -194,0 +196,0 @@ //We need to keep the domain relationships in tact |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
92863
3410