FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Pagination with Claude Code: Cursor-Based vs OFFSET and Infinite Scroll
NewsTools

Pagination with Claude Code: Cursor-Based vs OFFSET and Infinite Scroll

via Dev.tomyougaTheAxo3w ago

OFFSET pagination breaks on tables with millions of rows — each page requires scanning all previous rows. Cursor-based pagination stays fast at any scale. Claude Code generates the complete implementation. CLAUDE.md for Pagination Rules ## Pagination Design Rules ### Method - Over 10,000 rows: cursor-based required (OFFSET forbidden) - Admin UIs with small datasets: OFFSET pagination acceptable - Infinite scroll: cursor-based + hasNextPage ### Cursor-Based - Cursor must be opaque (don't expose internal structure to clients) - Encode cursor as Base64 of ID or composite key - Response includes nextCursor and hasNextPage ### Performance - Enforce pageSize limit (max 100) - orderBy required (needed for cursor-based sorting) - Index cursor column Generating Cursor Pagination Generate cursor-based pagination API. Endpoint: GET /api/users Parameters: cursor?, limit(1-100, default 20) Response: { data: User[], nextCursor: string | null, hasNextPage: boolean } Requirements: - Prisma cursor pagi

Continue reading on Dev.to

Opens in a new tab

Read Full Article
25 views

Related Articles

The Outbox Pattern: A Consistent Approach to Distributed Transactions
News

The Outbox Pattern: A Consistent Approach to Distributed Transactions

Medium Programming • 3d ago

6o6 v1.1: Faster 6502-on-6502 virtualization for a C64/Apple II Apple-1 emulator
News

6o6 v1.1: Faster 6502-on-6502 virtualization for a C64/Apple II Apple-1 emulator

Lobsters • 3d ago

ChemBERTa-2: Towards Chemical Foundation Models
News

ChemBERTa-2: Towards Chemical Foundation Models

Dev.to • 3d ago

Test title
News

Test title

Dev.to Tutorial • 3d ago

Legacy PC design misery
News

Legacy PC design misery

Lobsters • 3d ago

Discover More Articles