View Source Fob.Cursor (Fob v1.0.0)

A cursor data structure that can be used to fetch the next pages

The cursor data structure is somewhat similar to a Stream except that it cannot wrap a stateful process and does not require any life-cycle hooks. The next pages of data can be fetched by calling next/1 successively, passing in the updated t/0 data structure each time.

Link to this section Summary

Link to this section Types

@type t() :: %Fob.Cursor{
  page_breaks: [Fob.PageBreak.t()],
  page_size: pos_integer(),
  query: Ecto.Query.t(),
  repo: Ecto.Repo.t()
}

Link to this section Functions

Link to this function

new(queryable, repo, page_breaks, page_size)

View Source
@spec next(cursor :: t()) :: {records :: [map()], cursor :: t()}
@spec split(cursor :: t(), count :: non_neg_integer()) ::
  {records :: [map()], cursor :: t()}