@fachkraftfreund/n8n-nodes-supabase 1.3.9 → 1.3.10
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.
|
@@ -65,8 +65,12 @@ function deduplicateByConflictKeys(rows, conflictColumns) {
|
|
|
65
65
|
const compositeKey = keys.map((k) => {
|
|
66
66
|
const val = row[k];
|
|
67
67
|
if (val === null || val === undefined)
|
|
68
|
-
return '';
|
|
69
|
-
|
|
68
|
+
return '\x00null';
|
|
69
|
+
const str = String(val).trim();
|
|
70
|
+
const num = Number(str);
|
|
71
|
+
if (str !== '' && !isNaN(num))
|
|
72
|
+
return String(num);
|
|
73
|
+
return str.toLowerCase();
|
|
70
74
|
}).join('\0');
|
|
71
75
|
seen.set(compositeKey, i);
|
|
72
76
|
}
|
|
@@ -217,7 +221,9 @@ async function handleBulkUpsert(supabase, itemCount) {
|
|
|
217
221
|
if (deduplicate && onConflict) {
|
|
218
222
|
const before = rows.length;
|
|
219
223
|
rows = deduplicateByConflictKeys(rows, onConflict);
|
|
220
|
-
|
|
224
|
+
if (rows.length < before) {
|
|
225
|
+
console.log(`[Supabase UPSERT ${table}] dedup by "${onConflict}": ${before} → ${rows.length} rows`);
|
|
226
|
+
}
|
|
221
227
|
}
|
|
222
228
|
const returnData = [];
|
|
223
229
|
for (let offset = 0; offset < rows.length; offset += BULK_BATCH_SIZE) {
|
package/package.json
CHANGED