# `Ash.Expr`
[🔗](https://github.com/ash-project/ash/blob/v3.17.0/lib/ash/expr/expr.ex#L5)

Tools to build Ash expressions

# `t`

```elixir
@type t() :: any()
```

# `actor`

A template helper for using actor values in filter templates

# `arg`

A template helper for using action arguments in filter templates

# `atomic_ref`

A template helper for referring to the most recent atomic expression applied to an update field

# `calc`
*macro* 

```elixir
@spec calc(Macro.t(), opts :: Keyword.t()) :: t()
```

Creates an expression calculation for use in sort and distinct statements.

## Examples

```elixir
Ash.Query.sort(query, [
  {calc(string_upcase(name), :asc},
  {calc(count_nils([field1, field2]), type: :integer), :desc})
])
```

# `can_return_nil?`

# `combinations`

A template helper for creating a reference

# `context`

A template helper for using query context in filter templates

An atom will get the value for a key, and a list will be accessed via `get_in`.

# `determine_type`

# `determine_types`

# `eval`

Evaluate an expression. This function only works if you have no references, or if you provide the `record` option.

# `eval!`

Evaluate an expression. See `eval/2` for more.

# `expr`
*macro* 

```elixir
@spec expr(Macro.t()) :: t()
```

Creates an expression. See the [Expressions guide](/documentation/topics/reference/expressions.md) for more.

# `expr?`

```elixir
@spec expr?(term()) :: boolean()
```

Returns true if the value is or contains an expression

# `or_where`
*macro* 

```elixir
@spec or_where(Macro.t(), Macro.t()) :: t()
```

# `parent`

A template helper for creating a parent reference

# `ref`

A template helper for creating a reference

# `ref`

A template helper for creating a reference to a related path

# `template_references?`

Whether or not a given template contains an actor reference

# `template_references_argument?`

# `template_references_context?`

# `tenant`

A template helper for using the tenant in filter templates

# `to_sat_expression`

Prepares a filter for comparison

# `where`
*macro* 

```elixir
@spec where(Macro.t(), Macro.t()) :: t()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
