View source: R/request-helpers.R
| db_list_all_pages | R Documentation |
Collect Records from All API Response Pages
db_list_all_pages(list_page_fn, ...)
list_page_fn |
A listing function, such as |
... |
Arguments passed to |
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.
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.
Other Request Helpers:
db_perform_request(),
db_perform_response(),
db_req_error_body(),
db_request(),
db_request_json()
## Not run:
clusters <- db_list_all_pages(db_cluster_list, page_size = 100)
events <- db_list_all_pages(db_cluster_events, cluster_id = "cluster-id")
jobs <- db_list_all_pages(db_jobs_list, limit = 100)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.