Encoding of the ancestry column.
Two formats are supported, both compatible with the Ruby ancestry gem:
:materialized_path2(default, recommended) - roots store"/", a node whose ancestors are 1 and 2 stores"/1/2/". The column can beNOT NULLand descendant lookups are a singleLIKE 'prefix%'.:materialized_path- roots storeNULL, a node whose ancestors are 1 and 2 stores"1/2". Use it when migrating a table managed by the gem's legacy default format.
Summary
Functions
Ancestry value of the children of a node with the given ancestry and id.
Depth of a node with the given ancestry value (roots have depth 0).
Builds an ancestry value from a list of ancestor ids, root first.
Splits an ancestry value into its id segments (as strings), root first.
Value stored in the ancestry column of a root node.
Returns true if ancestry is well formed for the format and primary key type.
Types
Functions
Ancestry value of the children of a node with the given ancestry and id.
@spec depth(t(), String.t() | nil) :: non_neg_integer()
Depth of a node with the given ancestry value (roots have depth 0).
Builds an ancestry value from a list of ancestor ids, root first.
Splits an ancestry value into its id segments (as strings), root first.
Value stored in the ancestry column of a root node.
@spec valid?(t(), String.t() | nil, Ecto.Type.t()) :: boolean()
Returns true if ancestry is well formed for the format and primary key type.