@fachkraftfreund/n8n-nodes-supabase 1.3.7 → 1.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -62,7 +62,12 @@ function deduplicateByConflictKeys(rows, conflictColumns) {
|
|
|
62
62
|
const seen = new Map();
|
|
63
63
|
for (let i = 0; i < rows.length; i++) {
|
|
64
64
|
const row = rows[i];
|
|
65
|
-
const compositeKey = keys.map((k) => {
|
|
65
|
+
const compositeKey = keys.map((k) => {
|
|
66
|
+
const val = row[k];
|
|
67
|
+
if (val === null || val === undefined)
|
|
68
|
+
return '';
|
|
69
|
+
return String(val).trim().toLowerCase();
|
|
70
|
+
}).join('\0');
|
|
66
71
|
seen.set(compositeKey, i);
|
|
67
72
|
}
|
|
68
73
|
return Array.from(seen.values()).sort((a, b) => a - b).map((i) => rows[i]);
|
|
@@ -254,9 +259,7 @@ async function handleBulkUpdate(supabase, itemCount) {
|
|
|
254
259
|
if (deduplicate) {
|
|
255
260
|
const before = rows.length;
|
|
256
261
|
rows = deduplicateByConflictKeys(rows, matchColumn);
|
|
257
|
-
|
|
258
|
-
console.log(`[Supabase UPDATE ${table}] deduplicated input: ${before} → ${rows.length} rows by match column "${matchColumn}"`);
|
|
259
|
-
}
|
|
262
|
+
console.log(`[Supabase UPDATE ${table}] dedup by "${matchColumn}": ${before} → ${rows.length} rows`);
|
|
260
263
|
}
|
|
261
264
|
const returnData = [];
|
|
262
265
|
for (let offset = 0; offset < rows.length; offset += BULK_BATCH_SIZE) {
|
package/package.json
CHANGED