Astral.Schema.Field (Astral v0.2.0)

Copy Markdown View Source

A field declared in Astral's Ecto-style collection schema DSL.

Users declare fields with:

schema do
  field :title, :string, required: true
  field :draft, :boolean, default: false
end

Astral stores the declaration as this struct and uses Ecto changesets behind the scenes for casting, defaults, and required-field validation.

Summary

Types

t()

@type t() :: %Astral.Schema.Field{
  default: term(),
  name: atom(),
  required?: boolean(),
  type: term()
}