Skip to main content

Module embed_enum_shared_index

Module embed_enum_shared_index 

Source

Functions§

composite_index_shared_and_variant_field
An enum-level attribute may reference a variant field that owns its column via a variant::field path; combined with a shared field it produces a composite index. Composite unique indices are SQL-only (DynamoDB does not support them; see index_composite).
duplicate_column_without_shared_rejected
Two variant fields resolving to the same column name without a common #[shared] identifier are a duplicate column, not an implicit merge. The macro cannot catch this case (for embedded fields #[column] is a flattening prefix, not a single column), so the schema builder rejects it.
embedded_prefix_collision_is_not_duplicate
Embedded-struct variant fields sharing a #[column("...")] prefix are not a collision: the string prefixes each flattened leaf, so differently shaped embeds produce disjoint columns.
nested_enum_column_collision_rejected
Columns created while mapping a nested enum stay in the outer enum’s namespace: a later variant field of the outer enum whose flattened name collides with one of the nested enum’s columns is a duplicate, not a silent second column.
nested_enum_column_collision_rejected_reverse_order
Same collision as above, opposite order: the plain variant field comes first and the nested enum second, so the nested enum’s variant fields must be checked against column names the outer enum already created.
shared_field_column_override
A #[column("...")] override on a shared group renames the shared column; the shared identifier keeps naming the field in #[unique(...)], and the index lands on the renamed column. The override needs declaring on only one member of the group.
shared_field_non_unique_index
A non-unique enum-level #[index(name)] on a shared field produces a non-unique index and permits duplicate values across variants.
shared_field_unique_enforced_cross_variant
Uniqueness on a shared column is cross-variant: a Human and an Animal with the same name conflict, matching the shared column’s un-gated query semantics. Distinct names on either variant are accepted.
shared_field_unique_index_schema
An enum-level #[unique(name)] referencing a shared logical field produces one unique DB index on the single shared column.