Paginator and backend pagination with Supabase, numbers not working

Hi,

I looked all over and can’t find an answer to make this seemingly simple thing work.
What I do have working is everything (the arrows, but not the numbers) so I can advance back and forth with backend pagination and Supabase function passing the limit and offset. However how in the world do I get clicking on specific numbers in the Paginator to work? I was hoping I could simply tap into the number clicked and that would be it and we can easily set the page variable to that which would in turn be used to update the offset and then fetch. However there is no way to do that, which I find odd, because it is part of the core functionality of the Paginator and it does not seem to be implemented, at least for backend pagination. Please help.

Thank you :slight_smile:

Not 100% sure what you mean here, are you using wewebs pagination, supabase select or a custom postgres function?

I used WeWeb’s paginator and a postgres function at the same time based on the WeWeb docs to make the backend pagination work with the paginator. Everything is working except the actual numbers. So the < and > work fine. However the numbers in between when you click on them do not work because there is no way to get access to the number being clicked, I have tried a number of different approaches. It should be simple. Click 5 and that changes the page variable to 5 which in turn can update the offset variable based on the limit and then fetch. Seems simple, but no way to make it work since I can’t get at the numbers themselves and was hoping not to reinvent the wheel since WeWeb provides the paginator, except it is missing this one simple function that is totally core to it’s implementation. Any ideas? Thanks.

Just went and had a look at the docs cause I actually haven’t looked at them for paginator before but it looks like they’re actually using Xano so it’s a bit different. With Supabase just fetch your collection and then use that in the collection part with custom pagination off.

If I do that it will fetch ALL the records rather than some of the records, which is not a good approach if you have a ton of records, that is my understanding based on the docs, the difference between frontend and backend pagination. I am implementing backend pagination.

It won’t fetch all the records if you add pagination to your collection like the picture below.

With wewebs paginator it preforms an API call to supabase with offset and limit (your paginated number from the collection in the first picture).

If you’re doing something like this with no filters and have 100’s of thousands of rows then yes it’ll be bad (performance wise) but it won’t return all records. But adding filters can reduce this and make it significantly better.

I’m also not sure how much data you’re working with so I can’t say if this approach is good or not. If you could provide some more info/screenshots about your setup it would help me identify the solution.

I can try it out and see what happens performance wise. Thank you.