@fachkraftfreund/n8n-nodes-supabase 1.2.15 → 1.2.16
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.
|
@@ -891,6 +891,7 @@ class Supabase {
|
|
|
891
891
|
async execute() {
|
|
892
892
|
const items = this.getInputData();
|
|
893
893
|
const returnData = [];
|
|
894
|
+
console.log(`[Supabase] execute: ${items.length} input items`);
|
|
894
895
|
const credentials = await this.getCredentials('supabaseExtendedApi');
|
|
895
896
|
try {
|
|
896
897
|
(0, supabaseClient_1.validateCredentials)(credentials);
|
|
@@ -195,13 +195,24 @@ async function handleRead(supabase, itemIndex, hostUrl) {
|
|
|
195
195
|
const returnAll = this.getNodeParameter('returnAll', itemIndex, false);
|
|
196
196
|
const filters = getFilters(this, itemIndex);
|
|
197
197
|
const sort = this.getNodeParameter('sort.sortField', itemIndex, []);
|
|
198
|
+
for (const f of filters) {
|
|
199
|
+
const valType = Array.isArray(f.value) ? `array[${f.value.length}]` : typeof f.value;
|
|
200
|
+
const valLen = typeof f.value === 'string' ? f.value.length : Array.isArray(f.value) ? f.value.length : 0;
|
|
201
|
+
console.log(`[Supabase READ] item=${itemIndex} filter: ${f.column} ${f.operator} (${valType}, len=${valLen})`);
|
|
202
|
+
}
|
|
198
203
|
const overhead = (0, supabaseClient_1.estimateUrlOverhead)(hostUrl, table, returnFields, filters, sort);
|
|
199
204
|
const maxInChars = Math.max(500, supabaseClient_1.MAX_SAFE_URL_LENGTH - overhead);
|
|
200
205
|
const maxItems = (0, supabaseClient_1.computeMaxIdsPerChunk)(returnFields);
|
|
201
206
|
const filterChunks = (0, supabaseClient_1.expandChunkedFilters)(filters, maxInChars, maxItems);
|
|
207
|
+
console.log(`[Supabase READ] item=${itemIndex} table=${table} returnAll=${returnAll} chunks=${filterChunks.length} maxItems=${maxItems} maxInChars=${maxInChars}`);
|
|
202
208
|
const returnData = [];
|
|
203
209
|
if (returnAll) {
|
|
204
|
-
for (
|
|
210
|
+
for (let ci = 0; ci < filterChunks.length; ci++) {
|
|
211
|
+
const chunkFilters = filterChunks[ci];
|
|
212
|
+
const inFilter = chunkFilters.find(f => f.operator === 'in');
|
|
213
|
+
const chunkIds = inFilter && Array.isArray(inFilter.value) ? inFilter.value.length : '?';
|
|
214
|
+
console.log(`[Supabase READ] chunk ${ci + 1}/${filterChunks.length} (${chunkIds} IDs) - starting...`);
|
|
215
|
+
const chunkStart = Date.now();
|
|
205
216
|
const batchSize = 1000;
|
|
206
217
|
let batchOffset = 0;
|
|
207
218
|
let hasMore = true;
|
|
@@ -209,6 +220,7 @@ async function handleRead(supabase, itemIndex, hostUrl) {
|
|
|
209
220
|
const batchQuery = buildReadQuery(supabase, table, returnFields, chunkFilters, sort, { count: 'exact' });
|
|
210
221
|
const { data: batchData, error: batchError } = await batchQuery.range(batchOffset, batchOffset + batchSize - 1);
|
|
211
222
|
if (batchError) {
|
|
223
|
+
console.log(`[Supabase READ] chunk ${ci + 1} FAILED after ${Date.now() - chunkStart}ms: ${(0, supabaseClient_1.formatSupabaseError)(batchError)}`);
|
|
212
224
|
throw new Error((0, supabaseClient_1.formatSupabaseError)(batchError));
|
|
213
225
|
}
|
|
214
226
|
if (Array.isArray(batchData)) {
|
|
@@ -222,6 +234,7 @@ async function handleRead(supabase, itemIndex, hostUrl) {
|
|
|
222
234
|
}
|
|
223
235
|
batchOffset += batchSize;
|
|
224
236
|
}
|
|
237
|
+
console.log(`[Supabase READ] chunk ${ci + 1}/${filterChunks.length} done in ${Date.now() - chunkStart}ms, rows so far: ${returnData.length}`);
|
|
225
238
|
}
|
|
226
239
|
}
|
|
227
240
|
else {
|
package/package.json
CHANGED