AshVersioned

Hex.pm Hex Docs Apache-2.0

Resource versioning for Ash using Slowly Changing Dimension (type 2). There are multiple approaches to SCD type 2, but AshVersioned uses a version number column and a flag indicating the current version.

Compared to other approaches

Ash has three other approaches that answer the question "what did this resource look like before?" AshVersioned requires a structural commitment to the core resource definition, whereas the other options place history in separate tables.

AshVersioned trades the lower friction of out-of-band history for uniformity and durability.

AshVersioned uses one variation of SCD type 2. As stale rows have their update timestamps modified when they become stale, it shares many similarities with a (uni-) temporal table. AshVersioned is not designed for temporal use and cannot readily support more complex temporal types.

Installation

Add ash_versioned to your dependencies in mix.exs:

def deps do
[
{:ash_versioned, "~> 0.1"}
]
end

Documentation is found on HexDocs.

Tutorials

Topics

Reference

Semantic Versioning

AshVersioned follows Semantic Versioning 2.0.