View Source ScrollexEcto (ScrollexEcto v0.1.0)
ScrollexEcto is a pagination library for Ecto queries.
It provides both offset-based and cursor-based pagination methods.
Summary
Functions
A macro that injects pagination functionality into the using module.
Paginates the given queryable using the ScrollexEcto.Paginator.
Functions
A macro that injects pagination functionality into the using module.
Options
The opts
parameter can include:
:page_size
- The default number of items per page (default: 10):order_field
- The field to use for ordering in cursor-based pagination (default: :inserted_at):id_field
- The ID field to use as a tie-breaker in cursor-based pagination (default: :id)
Example
defmodule MyRepo do
use Ecto.Repo, otp_app: :my_app
use ScrollexEcto, page_size: 20
end
Paginates the given queryable using the ScrollexEcto.Paginator.
This function is called by the injected paginate/2
function and shouldn't be used directly.