AntlUtilsEcto.Paginator (antl_utils_ecto v0.6.0) View Source

Set of utils for Ecto about Pagination

Link to this section Summary

Link to this section Functions

Link to this function

paginate(queryable, page, opts \\ [])

View Source

Specs

paginate(any(), number(), keyword()) :: Ecto.Query.t()

Paginate.

Examples

iex> queryable = from u in "products" #Ecto.Query<from p0 in "products"> iex> Paginator.paginate(queryable, 1) #Ecto.Query<from p0 in "products", limit: ^100, offset: ^0> iex> Paginator.paginate(queryable, 2) #Ecto.Query<from p0 in "products", limit: ^100, offset: ^100> iex> Paginator.paginate(queryable, 3) #Ecto.Query<from p0 in "products", limit: ^100, offset: ^200> iex> Paginator.paginate(queryable, 3, [per_page: 10]) #Ecto.Query<from p0 in "products", limit: ^10, offset: ^20>