Shared offset-based pagination helper.
This module is used by HawkEx.Audit, HawkEx.Billing, and HawkEx.CSV to
keep dashboard-style pagination consistent. Host applications should usually
call the pagination functions on those context modules instead of calling
this module directly.
Summary
Functions
Paginates a base Ecto query.
Functions
Paginates a base Ecto query.
Options
:page- 1-indexed page number. Defaults to1.:per_page- rows per page. Defaults to50.:search- optional search term.:search_fun-(query, search_term) -> query, applied only when:searchis present and non-empty. Required if search may be passed.:order_by- keyword list passed to Ecto'sorder_by. Defaults to[desc: :inserted_at].:preload- value passed to Ecto'spreload. Defaults to[].
Returns %{entries:, page:, per_page:, total_count:, total_pages:}.