mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 10:02:05 +00:00
fix(Supabase Node): Pagination for get all rows (#8311)
This commit is contained in:
@@ -310,12 +310,18 @@ export class Supabase implements INodeType {
|
|||||||
qs.limit = this.getNodeParameter('limit', 0);
|
qs.limit = this.getNodeParameter('limit', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
let rows;
|
let rows: IDataObject[] = [];
|
||||||
|
|
||||||
try {
|
try {
|
||||||
rows = await supabaseApiRequest.call(this, 'GET', endpoint, {}, qs);
|
let responseLength = 0;
|
||||||
|
do {
|
||||||
|
const newRows = await supabaseApiRequest.call(this, 'GET', endpoint, {}, qs);
|
||||||
|
responseLength = newRows.length;
|
||||||
|
rows = rows.concat(newRows);
|
||||||
|
qs.offset = rows.length;
|
||||||
|
} while (responseLength >= 1000);
|
||||||
const executionData = this.helpers.constructExecutionMetaData(
|
const executionData = this.helpers.constructExecutionMetaData(
|
||||||
this.helpers.returnJsonArray(rows as IDataObject[]),
|
this.helpers.returnJsonArray(rows),
|
||||||
{ itemData: { item: i } },
|
{ itemData: { item: i } },
|
||||||
);
|
);
|
||||||
returnData.push(...executionData);
|
returnData.push(...executionData);
|
||||||
|
|||||||
Reference in New Issue
Block a user