Pagination
Cursor-based enumeration on the HTTP tier, frame-based streaming on the wire, and the terminator each one uses.
HTTP: cursors
Every paging verb takes limit and cursor, and returns next_cursor.
limitintegeroptionalPage size. The server caps it — ask for more and you get the cap, not an error.
cursorStringoptionalOpaque. Pass back exactly what the previous page returned. Do not parse, construct, or persist one across a schema change.
An empty page is a valid intermediate result: a filter can exclude
everything on one page while later pages still have rows. Stop when
next_cursor is absent, never when the page came back empty.
Which verbs page
| Verb | Returns |
|---|---|
| memory_list | items + cursor |
| list_entities | entities + count + cursor |
| list_statements | statements + count + cursor |
| statement_history | items + chain root + total + cursor |
| list_relations | relations + cursor |
| graph_fetch | nodes + edges + cursor |
| list_schemas | items + total + cursor |
list_spaces,
list_sessions and
list_extractors take a limit but do not
page — they return the whole bounded set. list_spaces instead reports
cross-shard completeness, which is a different kind of incompleteness: not
"there is more", but "this listing covered one shard".
Wire: frames
The wire tier streams. Every enumerating verb has two forms:
list_entities(request)concatenatedAwaits the whole stream and returns one flat collection. Simplest, and what you want when the result is small.
list_entities_frames(request)per-frameReturns the frames as they arrived, so you can render progressively or read the per-frame counters.
The pairs: memory_list, graph_fetch, recall, plan, reason,
statement_history, traverse_relations, list_entities,
list_statements, list_relations_from, list_relations_to and
list_schemas.
Wire cursors are Vec<u8>, not strings, and the wire listing requests carry
filters the HTTP tier does not expose — a time axis and a record/event time
range on memory_list, time ranges on the statement and relation listings.
Abandoning the call does not stop the server computing. Call cancel_stream with the stream id when you bail out of a long enumeration.
Was this page helpful?