stein v0.4.0 Stein.Pagination View Source

Paginate an Ecto query

Example:

iex> Stein.Pagination.paginate(Repo, query, %{page: 1, per: 10})
%{
  page: [...],
  pagination: %Stein.Pagination.Meta{
    current: 1,
    total: 2,
    total_count: 12,
    empty?: false
  }
}

Link to this section Summary

Link to this section Types

Link to this type

t() View Source
t() :: %Stein.Pagination{page: term(), pagination: term()}

Link to this section Functions

Link to this function

paginate(repo, query, arg3) View Source
paginate(Stein.repo(), query(), params()) :: t()

Paginate a query

Returns the current and total pages