View Source Ash.Type.Map (ash v3.4.47)

Represents a map stored in the database.

In postgres, for example, this represents binary encoded json

A builtin type that can be referenced via :map

  • :fields (keyword/0) - The types of the fields in the map, and their constraints.
    If constraints are specified, only those fields will be in the casted map.
    For example:
    fields:  [
      amount: [
        type: :integer,
        constraints: [
          max: 10
        ]
      ],
      currency: [
        type: :string,
        allow_nil?: false,
        constraints: [
          max_length: 3
        ]
      ]
    ]  
    allow_nil? is true by default
    • :type (an Ash.Type) - Required.

    • :allow_nil? (boolean/0) - The default value is true.

    • :constraints (keyword/0) - The default value is [].

Summary

Functions

field_types(value)

handle_change?()

prepare_change?()