Conversation
Temporal views become explicit fields on the DB handle (as-of-tx, since-tx, history?), and the per-index filter chains consolidate into `tx-visibility-xform` (plus a reverse variant for rseek, which slateval did not have): upper bound (basis / as-of), optional lower bound (since), and datoms-filter unless history. Temporal views are read-only — guarded in both conn/with and transact-tx-data. `with-dry-run` is a natural fit for the pending-overlay engine: the transaction runs normally but nothing is committed and the overlay stays on :db-after, so reads see the speculative datoms; chained dry-runs accumulate, and a real transact against a speculative value throws. Also ports Datomic's 5-element datom patterns binding the assert/retract flag ([?e :age ?a _ ?added]), which history views need to be useful. Bugfix found while porting (latent in slateval too): a `since` lower bound can orphan a retract by filtering out its add; `datoms-filter`'s pairing logic then emitted the tombstone as a datom and could even swallow an unrelated preceding add. It now never emits non-adds and never drops an add against an unrelated retract. With regression tests. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ports slateval's temporal features into dbval — the last functional delta between the two engines. After this merges, slateval's only remaining uniqueness is its storage adapter, which #8 already ports.
What's ported
as-of— the value of the database at transaction t (squuid or instant). Implemented as a basis bound: same value,max-txclamped to t.since— only datoms asserted after t (exclusive).history— all datom versions including retractions;:addeddistinguishes assert/retract.with-dry-run— speculative transactions. A perfect fit for the pending-overlay engine from Introduce dbval.store: pluggable tuple storage behind a protocol #7: the transaction runs normally, nothing commits, and the overlay stays on:db-afterso reads see the speculative datoms. Chained dry-runs accumulate; a real transact against a speculative value throws.[?e :age ?a _ ?added]) binding the assert/retract flag, Datomic-style — history views need this to be useful.as-of-t/since-t,temporal-view?; temporal views are read-only (guarded inconn/withandtransact-tx-data).Adaptation to dbval's architecture
slateval marks views by
associng namespaced keys onto its record DB; dbval's DB is an opaque deftype, so the markers are explicit fields (as-of-tx,since-tx,history?). The five inline per-index filter chains consolidate intotx-visibility-xform— plus a reverse variant slateval doesn't have, sorseek-datomsworks correctly on temporal views too.Bugfix found while porting (latent in slateval as well)
A
sincelower bound can orphan a retract by filtering out its add.datoms-filter's pairing logic assumed every retract directly follows its add, so an orphaned tombstone was emitted as a datom (sinceviews showed retracted pre-window values) and could even swallow an unrelated preceding add.datoms-filternow never emits non-adds and never drops an add against an unrelated retract — with regression tests for both scenarios. slateval needs the same one-line-shaped fix.Tests
dbval.test.time-travelported from slateval (as-of by squuid and by instant, since, history + 5-element patterns, dry-run visibility/chaining/guards) plus the two new since-with-retractions regressions. One portability fix: the instant-based as-of test needed a 5ms gap between transactions — SQLite commits fast enough for both txs to share a millisecond, which SlateDB's ~100ms commits masked.🤖 Generated with Claude Code
https://claude.ai/code/session_014dX8tTR4yFh5SyBGw3atpo