ash v1.5.0 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. Aggregations are made available on the meta field of a record

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

Specs

t() :: %Ash.Query{
  aggregates: term(),
  api: term(),
  data_layer_query: term(),
  errors: term(),
  filter: term(),
  limit: term(),
  offset: term(),
  resource: term(),
  side_load: term(),
  sort: term(),
  valid?: term()
}

Link to this section Functions

Link to this function

aggregate(query, name, type, relationship, agg_query \\ nil)

View Source

Adds an aggregation to the query. Aggregations are made available on the meta field of a record

Link to this function

build(resource, api \\ nil, keyword)

View Source

Specs

build(Ash.resource(), Ash.api() | nil, Keyword.t()) :: t()
Link to this function

do_validate_side_load(resource, query, path)

View Source

Limit the results returned from the query

Link to this function

new(resource, api \\ nil)

View Source

Create a new query.

Skip the first n records

Set the query's api, and any side loaded query's api

Link to this function

side_load(query, statement)

View Source

Side loads related entities

Link to this function

validate_side_load(resource, side_loads, path \\ [])

View Source