Fob.Cursor (Fob v0.6.1) View Source

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

Specs

t() :: %Fob.Cursor{
  page_breaks: Fob.page_breaks(),
  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

Specs

new(Ecto.Queryable.t(), Ecto.Repo.t(), Fob.page_breaks(), pos_integer()) :: t()

Specs

next(cursor :: t()) :: {records :: [map()], cursor :: t()}

Specs

split(cursor :: t(), count :: non_neg_integer()) ::
  {records :: [map()], cursor :: t()}