package granary

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Granary_ivm.DeltaSource

Lift row-mutation events into Z-set deltas (#417 Phase 3).

This is the bridge from a change feed (e.g. the engine's row-level delta feed, #419) to the incremental operators: an inserted element is +1, a deleted element is -1, and an update is the retraction of the old element plus the insertion of the new (-old +new) — so an update to an identical element is a no-op, and a sequence of events folds to a single Z-set delta.

Sourcetype 'elt event =
  1. | Insert of 'elt
    (*

    a row entered the relation

    *)
  2. | Delete of 'elt
    (*

    a row left the relation

    *)
  3. | Update of 'elt * 'elt
    (*

    a row changed: Update (old, new)

    *)

One change to a relation, over the element type a view ranges on (typically a projection of a stored row).

Sourcemodule Make (Z : Zset.S) : sig ... end

Make (Z) lifts events over Z.elt into Z.t deltas.