AshVersioned. VersionedRelationship
(ash_versioned v0.2.0)
Copy Markdown
Shared configuration for relationships to versioned resources, used by
belongs_to_actor (AshVersioned.Resource) and by belongs_to_versioned,
has_one_versioned, and has_many_versioned (AshVersioned.Relationships).
A relationship to a versioned resource:
- reads through the destination's
__ash_versioned_read__action, bypassing archive filtering; - filters on the destination's
__ash_versioned_latest__calculation, so that loads, aggregates,exists, and data layer joins all see only the latest version; and - for
belongs_to, joins on the destination's identity attribute rather than its primary key, so it never creates a foreign key (the identity is not unique across versions).
Summary
Functions
Options for Spark.Dsl.Transformer.build_entity!/4 building a belongs_to to
a versioned resource with the given identity attribute.
Adds an ignored postgres.references entry for the relationship, so that AshPostgres
doesn't generate a foreign key to a non-unique identity attribute. Does nothing if the
data layer isn't AshPostgres or if a reference for the relationship is already declared.
The name of the boolean calculation added to every AshVersioned.Resource to filter to
the latest version of a record.
The filter applied to every relationship to a versioned resource.
Marks a relationship as a versioned relationship, already configured for a versioned destination.
Applies the latest filter to a relationship struct before its Ash transform/1 runs,
and marks it as a versioned relationship.
The name of the read action added to every AshVersioned.Resource, scoped to the
latest version of each record, ignoring archiving.
Returns true if the relationship was declared with one of the *_versioned
relationship entities, or is a belongs_to_actor relationship to a versioned resource.
Functions
Options for Spark.Dsl.Transformer.build_entity!/4 building a belongs_to to
a versioned resource with the given identity attribute.
Adds an ignored postgres.references entry for the relationship, so that AshPostgres
doesn't generate a foreign key to a non-unique identity attribute. Does nothing if the
data layer isn't AshPostgres or if a reference for the relationship is already declared.
The name of the boolean calculation added to every AshVersioned.Resource to filter to
the latest version of a record.
The filter applied to every relationship to a versioned resource.
Marks a relationship as a versioned relationship, already configured for a versioned destination.
Applies the latest filter to a relationship struct before its Ash transform/1 runs,
and marks it as a versioned relationship.
The name of the read action added to every AshVersioned.Resource, scoped to the
latest version of each record, ignoring archiving.
Returns true if the relationship was declared with one of the *_versioned
relationship entities, or is a belongs_to_actor relationship to a versioned resource.