Paginate repository list endpoints before exposing them via the API #10
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?
Several repository list functions return an unbounded
Vec:catalog::list_objects(crates/db/src/catalog.rs) — already carries aTODO.vocab::list_terms(crates/db/src/vocab.rs).authority::list_by_kind(crates/db/src/authority.rs).(Audit's
history_foris tracked separately in #6.)Before any of these is exposed through the HTTP API (admin UI in Plan 10, public API in Plan 7), add LIMIT / keyset pagination — keyset on the existing
ORDER BYcolumn is natural and index-friendly (object_numberfor objects;id/seqelsewhere). Unbounded lists are fine at the repository layer with no API consumer, but must be bounded before the API lands.Source: Plan 3 (catalogue core) final review — deferred until there's an API consumer.
Scope note from the admin-CRUD work (merged
main@c4e0c4c): the object list endpoint is paginated (db::catalog::list_objects_paged+count_objects, exposed asGET /api/admin/objectswith limit/offset/total). However three new admin list endpoints return all rows unpaginated:GET /api/admin/field-definitions(db::fields::list_field_definitions)GET /api/admin/vocabularies/{id}/terms(db::vocab::list_terms)GET /api/admin/authorities?kind=(db::authority::list_by_kind)These are small, bounded sets today (and
list_vocabularieslikewise), so leaving them unpaginated is acceptable for now — but they fall under this issue and should be paginated if/when they can grow large.