Skip to content

Commit

Permalink
fix(Supabase Node): Pagination for get all rows (#8311)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-radency authored and netroy committed Jan 16, 2024
1 parent 2410047 commit 69795df
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions packages/nodes-base/nodes/Supabase/Supabase.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,18 @@ export class Supabase implements INodeType {
qs.limit = this.getNodeParameter('limit', 0);
}

let rows;
let rows: IDataObject[] = [];

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(
this.helpers.returnJsonArray(rows as IDataObject[]),
this.helpers.returnJsonArray(rows),
{ itemData: { item: i } },
);
returnData.push(...executionData);
Expand Down

0 comments on commit 69795df

Please sign in to comment.