AshVersioned. IdentityScoping
(ash_versioned v0.1.0)
Copy Markdown
Determines whether an Ash.Resource.Identity is usable on an AshVersioned.Resource.
All user-defined identities on a versioned resource must conform to exactly one of these
constraints:
- it must have a partial lookup
where latest == true; or - it must be a superset of the full record history (
{identity, version}) and must not have a partial lookupwhere latest == true; or
Identity definitions that do not follow these conventions will eventually trip the
uniqueness guarantees provided by the default identities. The functions in this module
are used by AshVersioned.Verifiers.VerifyIdentityScoping to ensure that invalid
identities are caught at compile time, and by AshVersioned.Transformers.AddFields to
ensure that partial indexes are created correctly.
Additional conditions for partial lookups are not currently supported.
Summary
Functions
Returns true if identity's keys include both identity_field and version_field
and does not include latest_field.
Returns true if identity conforms to one of the two required indexes.
Returns true if the identity where clause is {latest} == true.
Functions
Returns true if identity's keys include both identity_field and version_field
and does not include latest_field.
Returns true if identity conforms to one of the two required indexes.
Returns true if the identity where clause is {latest} == true.
Complex where expressions are rejected.