Category: Supabase and databases

CRM shows only the first 100 leads — Supabase Pagination

Read this guide in Polish

There are a lot of contacts in the database, but after changing or searching in CRM you can only see the first batch.

Why is this happening?

Frontend can download a single data range and filter only locally, and the user thinks he is searching the entire database.

Step by step solution

1. Compare count in the database with the number of records actually returned by the query.

2 . Enter a public page on the server side with range or limit and offset, depending on the API used.

3 . Add stable sorting with second key, e.g. date and ID, so records with identical dates do not jump between pages.

4 . Search for text and filters before pagination on the query side, not up to 100 already downloaded lines.

5 . Support next pages, empty score, network error, and reset page number after changing the filter.

How do I check the score?

The last test set record is available and the search finds it without having to scroll all pages.

Check the default limits and configuration of a particular project in the Supabase panel. Do not assume that every installation has an identical limit.