trubo_ecto v0.1.3 Trubo.Ecto.Hooks.Paginate

Single table Paginate.

Link to this section Summary

Link to this section Functions

Link to this function do_get_paginate(queryable, formated_params, repo)
Link to this function get_paginate(queryable, params, opts)
Link to this function run(queryable, params)

Returns paginate queryable.

Example

iex> params = %{"per_page" => 5, "page" => 2}
iex> Trubo.Ecto.Hooks.Paginate.run(Trubo.Ecto.Product, params)
#Ecto.Query<from p in Trubo.Ecto.Product, limit: ^5, offset: ^5>