• v0.8.0 792e509b67

    u.schuster released this 2026-04-30 00:10:03 +02:00 | 8 commits to main since this release

    The decorator's save() flow now preserves the live row's id PK across
    updates and captures each prior version as a fresh row with a new id.
    This unblocks fewo-webapp#459: the consumer's composite-FK schema needs
    stable child references to the live row (UNIQUE(entity_id, valid_until)
    with ON UPDATE CASCADE on every child FK), which the previous
    close-then-insert flow couldn't provide.

    New flow on update (when a live row exists for entity_id):

    1. Clone the live row in memory (cloneDto via oatpp reflection),
      assign a fresh id and set valid_until=now, save → INSERT historical.
    2. Set the new dto's id=live.id (preserve PK), valid_from=now,
      valid_until=SENTINEL, save → inner UPDATEs the live row in place by
      PK.

    Inner adapter contract changes from "upsert keyed by (entity_id,
    valid_from)" to "upsert keyed by id (per-row PK)". TemporalFieldTraits
    gains an id() accessor; OATPP_AUTHKIT_REGISTER_TEMPORAL grows from 4 to
    5 args (Dto + IdMember + EntityIdMember + FromMember + UntilMember).

    Tests: test_repository_decorators asserts livePk stability across saves
    and fresh historicalPk per version; remaining decorator tests updated to
    the 5-arg macro form. README's TemporalRepository.hpp row rewritten to
    describe the new write semantics.

    Bumped CMake version 0.7.0 → 0.8.0 (semantic break — save() no longer
    reallocates the live PK; consumers depending on the old contract need
    audit).

    Closes #13

    Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

    Downloads