pub struct ReadView {
pub include_superseded: bool,
pub include_inactive: bool,
pub include_out_of_window: bool,
pub valid_as_of: Option<i64>,
}Expand description
0.8.20 Slice 10b (R-20-RV / R-20-NV) — the read view: the single knob
that decides which canonical_nodes rows a read verb may see.
Every field is a relaxation: ReadView::default() is the STRICT view and
compiles to exactly the predicates the five read verbs carried before this
slice (superseded_at IS NULL AND state = 'active'), so the default read
path is behaviourally unchanged. Flags compose INDEPENDENTLY — each one
drops exactly one conjunct and no other.
The view is applied UNIFORMLY by Engine::read_get,
Engine::read_get_many, Engine::read_list,
Engine::read_list_filter and Engine::graph_neighbors — and, inside
graph_neighbors, at EVERY position of EVERY direction’s recursive CTE
(anchor, recursive join, final projection), so a relaxation cannot silently
apply on one traversal position and not another.
§World-time only
valid_as_of selects along the world-time (validity) axis only.
Transaction-time / history_as_of is explicitly OUT OF SCOPE — this type
deliberately has no way to ask “what did the database believe at time T”.
Fields§
§include_superseded: boolRelax superseded_at IS NULL — include superseded (historical) versions
of a row, not just the current one. false (default) keeps the shipped
current-version-only behaviour.
On the point-lookup verbs (Engine::read_get /
Engine::read_get_many) a logical_id can now match several rows;
the slot resolves DETERMINISTICALLY to the highest write_cursor (the
most recent version). Use Engine::read_list to enumerate history.
include_inactive: boolRelax state = 'active' — include rows in a non-active lifecycle
state (pending / deleted / purged). false (default) keeps the
shipped active-only behaviour.
include_out_of_window: boolRelax the validity-window predicate ENTIRELY — return rows whatever
their [valid_from, valid_until) window, ignoring valid_as_of.
false (default) filters to rows valid at the selected instant.
Note this is a NO-OP on any row with an unbounded (NULL/NULL) window, which is every row that predates schema step 22.
valid_as_of: Option<i64>The instant (INTEGER epoch SECONDS, UTC) at which validity is evaluated.
None (default) resolves to now at query time.
This is the :now seam: whichever way it resolves, the instant is
compiled as a BOUND PARAMETER, never a datetime('now') SQL literal —
which is what makes node validity deterministically testable without
clock games. (The shipped EDGE temporal filter still inlines
datetime('now'); that path is untouched by this slice.)