View Source Ash.Query.Aggregate (ash v2.6.0)

Represents an aggregated association value

Link to this section Summary

Link to this section Types

@type kind() :: :custom | :avg | :min | :max | :list | :sum | :first | :count
@type t() :: %Ash.Query.Aggregate{
  constraints: term(),
  default_value: term(),
  field: term(),
  filterable?: term(),
  implementation: term(),
  kind: term(),
  load: term(),
  name: term(),
  query: term(),
  relationship_path: term(),
  resource: term(),
  type: term()
}

Link to this section Functions

Link to this function

new!(resource, name, kind, opts \\ [])

View Source
Link to this function

new(resource, name, kind, opts \\ [])

View Source

Create a new aggregate, used with Query.aggregate or Api.aggregate

Options:

  • path: Used when adding an aggregate to a query.
  • query: A base query to use for the aggregate
  • field: The field to aggregate
  • default: A default value for the aggregate
  • filterable?: Wether or not it should be filterable
  • type: A type for the aggregate
  • constraints: Type constraints for the aggregate's type
  • implementation: The implementation module for custom aggregates
Link to this function

new(resource, name, kind, relationship, query, field, default \\ nil, filterable? \\ true, type \\ nil, constraints \\ [], implementation \\ nil)

View Source
Link to this function

requests(initial_query, can_be_in_query?, authorizing?, calculations_in_query, request_path)

View Source