Liking cljdoc? Tell your friends :D

ebifriedrice.rsqlite.match

Pure invalidation decisions: which registered queries must re-run given the events a transaction produced.

This is the posh datom-matcher's analogue and the cheap check the engine runs before re-executing anything. Events arrive per row with per-row changed columns (already name-resolved); coalesce merges them per table; affected? applies the rules:

  • :all dependencies always re-run;
  • a table not in the query's tables never re-runs it;
  • inserted or deleted rows re-run every query on the table (a new row appears in results regardless of which columns it set);
  • a coarse event (unknown columns) re-runs everything on the table;
  • a wildcard over the table re-runs on any change to it;
  • otherwise only when a changed column is among the query's columns.

All names must already be normalised (sqldeps/norm-name).

Pure invalidation decisions: which registered queries must re-run
given the events a transaction produced.

This is the posh datom-matcher's analogue and the cheap check the
engine runs before re-executing anything. Events arrive per row
with per-row changed columns (already name-resolved); coalesce
merges them per table; affected? applies the rules:

- :all dependencies always re-run;
- a table not in the query's tables never re-runs it;
- inserted or deleted rows re-run every query on the table (a new
  row appears in results regardless of which columns it set);
- a coarse event (unknown columns) re-runs everything on the table;
- a wildcard over the table re-runs on any change to it;
- otherwise only when a changed column is among the query's
  columns.

All names must already be normalised (sqldeps/norm-name).
raw docstring

affectedclj/s

(affected events deps-by-id)

Ids of the queries whose deps any of the coalesced events hit.

Ids of the queries whose deps any of the coalesced events hit.
sourceraw docstring

affected?clj/s

(affected? {:keys [table changed-cols rows-inserted rows-deleted]} deps)

True when a coalesced event for one table invalidates a query with the given dependency profile.

True when a coalesced event for one table invalidates a query
with the given dependency profile.
sourceraw docstring

changed-colsclj/s

(changed-cols {:keys [op old new]} col-names)

Column names a raw positional event actually changed, given the table's declared names - the off-writer half of preupdate event materialization (names cannot be resolved inside the hook; asking sqlite means preparing a statement). Updates keep only differing positions; inserts and deletes report every column.

Column names a raw positional event actually changed, given the
table's declared names - the off-writer half of preupdate event
materialization (names cannot be resolved inside the hook; asking
sqlite means preparing a statement). Updates keep only differing
positions; inserts and deletes report every column.
sourceraw docstring

coalesceclj/s

(coalesce events)

Merge per-row events into one event per table.

Merge per-row events into one event per table.
sourceraw docstring

event-schemaclj/s

source

raw-event-schemaclj/s

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close