AntlUtilsEcto.Paginator (antl_utils_ecto v1.2.0) View Source
Set of utils for Ecto about Pagination
Link to this section Summary
Link to this section Functions
Specs
paginate(any(), pos_integer(), pos_integer()) :: Ecto.Query.t()
Paginate.
Examples
iex> queryable = from u in "products" #Ecto.Query<from p0 in "products"> iex> Paginator.paginate(queryable, 1, 100) #Ecto.Query<from p0 in "products", limit: ^100, offset: ^0> iex> Paginator.paginate(queryable, 2, 100) #Ecto.Query<from p0 in "products", limit: ^100, offset: ^100> iex> Paginator.paginate(queryable, 3, 100) #Ecto.Query<from p0 in "products", limit: ^100, offset: ^200> iex> Paginator.paginate(queryable, 3, 10) #Ecto.Query<from p0 in "products", limit: ^10, offset: ^20>