Collect Records from All API Response Pages
Arguments
- list_page_fn
A listing function, such as
db_cluster_list(),db_cluster_events(), ordb_jobs_list(). It must acceptpage_tokenand return a named list containing record collections and, when more pages are available,next_page_token.- ...
Arguments passed to
list_page_fnon every request, including filters, page size,host, andtoken. Leavepage_tokenandperform_requestat their defaults; this helper fetches the pages.
Value
A list of records from all pages, in request order, with record
classes and nested fields preserved. Pagination metadata is omitted.
Returns list() when there are no records. All pages are held in memory.
Details
Removes the top-level pagination fields next_page_token, prev_page_token,
next_page, total_count, has_more, and has_next_page, then combines the
remaining record collections. No collection field name is needed. Use a
listing function whose remaining response fields contain lists of records.
Wrappers that already flatten their response, such as db_lakebase_list(),
are not supported.
Uses token pagination, starting at the first page. Leave legacy pagination
arguments unset, such as offset and limit in db_cluster_events(). Empty
pages with a continuation token are followed. Request errors and repeated
tokens stop collection with an error.
See also
Other Request Helpers:
db_perform_request(),
db_perform_response(),
db_req_error_body(),
db_request(),
db_request_json()
