class beneath.Cursor[source]

A cursor allows you to page through the results from of a query in Beneath.


The replay cursor, which pages through the initial query results


The change cursor, which can return updates since the query was started

async read_one()[source]

Returns the first record or None if the cursor is empty

async read_next(limit: int = 1000, to_dataframe=False)Iterable[][source]

Returns a new page of results and advances the replay cursor

async read_next_changes(limit: int = 1000, to_dataframe=False)Iterable[][source]

Returns a new page of changes and advances the change cursor

async read_all(max_records=None, max_bytes=26214400, batch_size=1000, warn_max=True, to_dataframe=False)Iterable[][source]

Returns all records in the cursor (up to the limits of max_records and max_bytes)

subscribe_changes(batch_size=1000, poll_at_most_every_ms=1000)AsyncIterator[List[]][source]

Similar to subscribe_changes_with_callback, but as an async iterator. Note that yielded values are batches, not individual records.

async subscribe_changes_with_callback(callback: Callable[[List[], beneath.cursor.Cursor], Awaitable[None]], batch_size=1000, poll_at_most_every_ms=1000)[source]

Subscribes to new changes and calls callback with new batches of records.