Skip to main content

Module backfill

Module backfill 

Source
Expand description

Backfill count derivation for StepKind::Backfill steps.

TypeDB’s insert answer is QueryResult::Ok — it carries no affected-row count. This module derives matched/inserted/skipped counts via bracketing reduce $c = count; read queries around the write (D2).

§Cost

Two extra read-transaction count queries are issued per backfill step (guarded count before insert, total-source count before insert). This is acceptable for one-shot migrations and is the only way to surface counts given TypeDB’s write answer surface.

§Invariant 2 compliance

The count queries are composed directly from the carried step.forward match clause — no op-semantic re-derivation occurs here. The backfill step’s forward text is the single source of truth for the query shape.

Structs§

BackfillResult
Per-step backfill count result.

Functions§

execute_backfill
Execute a backfill ExecutionStep against db, deriving and returning matched/inserted/skipped counts.