OuterfacesEctoApi.QueryEngine.QueryPager (Outerfaces Ecto API v0.2.8)
View SourceSummary
Functions
Applies ordering, limit, and offset to a given query.
Types
@type pagination_info() :: %{ total_count: non_neg_integer(), total_pages: pos_integer(), has_next_page: boolean(), has_previous_page: boolean(), limit: non_neg_integer(), offset: non_neg_integer() }
Functions
@spec apply_paging(Ecto.Query.t(), map()) :: Ecto.Query.t()
Applies ordering, limit, and offset to a given query.
Parameters:
- query: The Ecto query.
- params: A map containing "limit", and "offset".
Example usage: QueryPager.apply_paging(query, %{"limit" => 10, "offset" => 20})
@spec compute_pagination(map(), non_neg_integer()) :: pagination_info()