ash v1.6.1 Ash.Query View Source
Utilties around constructing/manipulating ash queries.
Ash queries are used for read actions and side loads, and ultimately map to queries to a resource's data layer.
Link to this section Summary
Functions
Adds an aggregation to the query.
Limit the results returned from the query
Create a new query.
Skip the first n records
Set the query's api, and any side loaded query's api
Side loads related entities
Link to this section Types
Link to this section Functions
Specs
aggregate( t() | Ash.resource(), atom(), Ash.aggregate_kind(), atom() | [atom()], Ash.query() | nil ) :: t()
Adds an aggregation to the query.
Aggregations are made available on the aggregates
field of the records returned
The only aggregate available currently is a count
aggregate. They filter option accepts
either a filter or a keyword list of options to supply to build a limiting query for that aggregate.
However, currently only filters are accepted.
Specs
build(Ash.resource(), Ash.api() | nil, Keyword.t()) :: t()
Specs
filter(t() | Ash.resource(), nil | false | Ash.filter() | Keyword.t()) :: t()
Specs
limit(t() | Ash.resource(), nil | integer()) :: t()
Limit the results returned from the query
Specs
Create a new query.
Specs
offset(t() | Ash.resource(), nil | integer()) :: t()
Skip the first n records
Set the query's api, and any side loaded query's api
Specs
side_load(t() | Ash.resource(), Ash.side_loads()) :: t()
Side loads related entities
Specs
sort(t() | Ash.resource(), Ash.sort()) :: t()
Specs
unset(Ash.resource() | t(), atom() | [atom()]) :: t()