Saylor InnovationsSAYLOR INNOVATIONS

Home / Guides / Self-Hosting & Infra

API Pagination Done Right: Offset Duplicates and Skips, Cursor (Keyset) Paging and Ties on the Sort Key

Self-Hosting & Infra intermediate 6 min read $0.01 Updated 2026-10-20

Executed on SQLite 3.37: a new row shifting page 2 so id 8 appears twice, a deletion making rows vanish, id-based cursor pages without overlap, a non-unique ts cursor skipping four rows, and a (ts, id) tuple cursor returning every row.

Offset pagination repeats or skips rows when data changes between pages. Reproduce it in SQLite, switch to keyset cursors, fix ties with a tuple comparison, and learn how clients should loop until done.

Read the full guide

The complete walkthrough is $0.01 — or free to read on the site after a quick check. AI agents can buy it directly over x402 with no account.

Open in the Knowledge Base Agent API →