Chunkr.Opts (Chunkr v0.2.1) View Source
Options for paginating.
Fields
:repo— TheEcto.Repofor the query.:planner— The module implementing the pagination strategy.:query— The non-paginated query to be extended for pagination purposes.:strategy— The name of the pagination strategy to use.:sort_dir— The primary sort direction used for the query. Note that this aligns with the very firstsortclause registered in the named pagination strategy. Any subsequent sort directions within the strategy will always be automatically adjusted to maintain the overall strategy.:paging_dir— Either:forwardor:backwarddepending on whether gathering results from the start or the end of the result set (i.e. whether the limit was specified as:firstor:last).:cursor— The:afteror:beforecursor beyond which results are retrieved.:max_limit— The maximum allowed page size.:limit— The requested page size (as specified by:firstor:last).
Link to this section Summary
Functions
Validate provided options and return a Chunkr.Opts struct
Link to this section Types
Specs
sort_dir() :: :asc | :desc
Specs
t() :: %Chunkr.Opts{
cursor: Chunkr.Cursor.opaque_cursor() | nil,
limit: pos_integer(),
max_limit: pos_integer(),
paging_dir: :forward | :backward,
planner: atom(),
query: Ecto.Query.t(),
repo: atom(),
sort_dir: sort_dir(),
strategy: atom()
}
Link to this section Functions
Specs
Validate provided options and return a Chunkr.Opts struct