Returns the primary key field of the schema. Only single-column keys are supported.
Compile-time configuration of a schema that uses AncestryEx.
A config is built by use AncestryEx and can be retrieved at runtime with
MySchema.__ancestry__/0. See AncestryEx for the list of options.
Summary
Functions
Casts a value (usually a segment of the ancestry string) to the primary key type.
Returns the config of the given schema module or struct.
Builds and validates a config for schema. Raises ArgumentError on invalid options.
Returns the primary key field of the schema. Only single-column keys are supported.
Returns the Ecto type of the primary key.
Types
@type orphan_strategy() :: :destroy | :rootify | :adopt | :restrict | :none
@type t() :: %AncestryEx.Config{ column: atom(), counter_cache_column: atom() | nil, depth_column: atom() | nil, depth_mode: :stored | :virtual | nil, format: AncestryEx.Format.t(), orphan_strategy: orphan_strategy(), schema: module(), touch: boolean() }
Functions
Casts a value (usually a segment of the ancestry string) to the primary key type.
Returns the config of the given schema module or struct.
Builds and validates a config for schema. Raises ArgumentError on invalid options.
@spec primary_key_type(t()) :: Ecto.Type.t()
Returns the Ecto type of the primary key.