paginate — Full Pagination
Returns a total count and page metadata. Use when you need page numbers or a “Page 3 of 47” UI.
COUNT(*) query on every request — can be slow on large tables.
simplePaginate — Next/Prev Only
No total count. Just tells you whether there’s a next page. Use for “Load more” or “Next / Previous” navigation.
cursorPaginate — Cursor-Based Pagination
Paginates using a cursor value (usually a column like id or created_at) instead of page offsets. Consistent even when rows are inserted or deleted between requests.
Comparison
paginate | simplePaginate | cursorPaginate | |
|---|---|---|---|
| Total count | Yes | No | No |
| Jump to page | Yes | No | No |
| Stable with inserts | No | No | Yes |
| Extra COUNT query | Yes | No | No |
| Best for | Dashboards | Load more | Feeds, APIs |
