forked from 0xWheatyz/SPARC
Feature: Cursor-based pagination for /analyze/batch and /jobs endpoints #488
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Roadmap item: P3 - API pagination
Description
The
/analyze/batchand/jobsendpoints return all results in a single response. For large datasets this is slow and memory-intensive. Cursor-based pagination would allow clients to fetch results incrementally.Task
GET /jobs(and/analyze/batchif applicable).cursorandlimitquery parameters.next_cursorin the response for subsequent pages.Acceptance Criteria
GET /jobs?limit=20returns at most 20 results with anext_cursor.GET /jobs?cursor=<token>&limit=20returns the next page.next_cursor: null.cursorstill receive results (defaulting to first page).Already implemented. Cursor-based pagination exists in
DatabaseClient.list_jobs()(SPARC/database.pylines 596-638) using(created_at, job_id)as the cursor. The/jobsAPI endpoint exposes cursor and next_cursor parameters. Merged via PR #59. Closing as completed.