View Source Ash.Query.Calculation (ash v3.0.0)

Represents a calculated attribute requested on a query

Summary

Types

@type t() :: %Ash.Query.Calculation{
  calc_name: term(),
  constraints: term(),
  context: term(),
  filterable?: term(),
  load: term(),
  module: term(),
  name: term(),
  opts: term(),
  required_loads: term(),
  select: term(),
  sensitive?: term(),
  sortable?: term(),
  type: term()
}

Functions

Link to this function

new(name, module, calc_opts, type, constraints, opts \\ [])

View Source

Creates a new query calculation.

Options

  • :arguments (map/0) - Arguments to pass to the calculation The default value is %{}.

  • :filterable? (boolean/0) - Whether or not this calculation can be filtered on The default value is true.

  • :sortable? (boolean/0) - Whether or not this calculation can be sorted on The default value is true.

  • :sensitive? (boolean/0) - Whether or not references to this calculation will be considered sensitive The default value is false.

  • :load (term/0) - Loads that are required for the calculation.

  • :source_context (map/0) - Context from the source query or changeset. The default value is %{}.