Pagination support for AshScylla using ScyllaDB/Cassandra tokens.
ScyllaDB/Cassandra doesn't support OFFSET natively. Instead, it uses tokens for efficient pagination.
Summary
Functions
Builds a CQL query with token-based pagination.
Fetches a page of results using token-based pagination.
Functions
Builds a CQL query with token-based pagination.
@spec fetch_page(module(), String.t(), map(), term(), pos_integer()) :: {:ok, {[term()], term()}} | {:error, term()}
Fetches a page of results using token-based pagination.
Examples
# First page
{:ok, {records, next_token}} = DataLayer.Pagination.fetch_page(repo, table, %{}, nil, 10)
# Next page using token
{:ok, {records, next_token}} = DataLayer.Pagination.fetch_page(repo, table, %{}, token, 10)