# `Ash.Type.Range`
[🔗](https://github.com/ash-project/ash/blob/v3.33.0/lib/ash/type/range.ex#L5)

A continuous range of values of an inner type — the value type for temporal
period columns (e.g `valid_at`).

Parametrized by its inner type via constraints (one of `:date`, `:integer`,
`:naive_datetime`, `:datetime`):

    attribute :valid_at, Ash.Type.Range, constraints: [inner_type: :datetime]

Casts to/from an `Ash.Range` struct. The data layer maps it to a native range
type — `ash_postgres` renders `:datetime` as `tstzrange`, `:date` as
`daterange`, `:naive_datetime` as `tsrange`, `:integer` as `int8range`.

### Constraints

* `:inner_type` - Required. The type of the range's bounds. One of [:date, :integer, :naive_datetime, :datetime]. Valid values are :date, :integer, :naive_datetime, :datetime

* `:inner_constraints` (`t:keyword/0`) - Constraints applied to each bound, passed through to the inner type. The default value is `[]`.

* `:lower` (`t:keyword/0`) - Constraints on the range's lower bound. The default value is `[]`.

  * `:required?` (`t:boolean/0`) - The range must have a lower bound. The default value is `false`.

  * `:inclusive?` (`t:boolean/0`) - The lower bound, where there is one, must include its own value.

* `:upper` (`t:keyword/0`) - Constraints on the range's upper bound. The default value is `[]`.

  * `:required?` (`t:boolean/0`) - The range must have an upper bound. The default value is `false`.

  * `:inclusive?` (`t:boolean/0`) - The upper bound, where there is one, must include its own value.

* `:allow_empty?` (`t:boolean/0`) - If false, a range containing no points is refused. The default value is `false`.

# `handle_change?`

# `prepare_change?`

---

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