Torch.Helpers.paginate

You're seeing just the function paginate, go back to Torch.Helpers module for more information.
Link to this function

paginate(query, repo, params, settings \\ [page_size: 10])

View Source

Specs

paginate(Ecto.Queryable.t(), Ecto.Repo.t(), params(), Keyword.t()) ::
  %Scrivener.Page{
    entries: term(),
    page_number: term(),
    page_size: term(),
    total_entries: term(),
    total_pages: term()
  }

Paginates a given Ecto.Queryable using Scrivener.

This is a very thin wrapper around Scrivener.paginate/2, so see the Scrivener Ecto documentation for more details.

Parameters

  • query: An Ecto.Queryable to paginate.
  • repo: Your Repo module.
  • params: Parameters from your conn. For example %{"page" => 1}.
  • settings: A list of settings for Scrivener, including :page_size.

Examples

paginate(query, Repo, params, [page_size: 15])
# => %Scrivener.Page{...}