View Source Ash.Calculation behaviour (ash v2.19.3)
The behaviour for a calculation module
Use select/2
to apply a select statement when the calculation is loaded.
This does not apply in the case that you are loading on existing resources using
MyApi.load
. It also doesn't apply when the calculation is used in a filter or sort,
because it is not necessary to select fields to power filters done in the data layer.
Summary
Types
@type opts() :: Keyword.t()
Callbacks
@callback has_expression?() :: boolean()
@callback select(query :: Ash.Query.t(), opts :: opts(), context :: context()) :: [atom()]