Skip to main content

execute_backfill

Function execute_backfill 

Source
pub async fn execute_backfill(
    db: &Database,
    step: &ExecutionStep,
    step_index: usize,
) -> Result<BackfillResult, MigrationError>
Expand description

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

§Execution sequence

  1. Run a Read count query over the guarded match clause (the insert-if-absent predicate — rows that will be inserted).
  2. Run a Read count query over the unguarded match clause (all candidate rows, including those already having the destination).
  3. Run the forward TypeQL under a Write transaction and commit.

Steps 1 and 2 run before the write so the counts reflect the pre-write state.

§Invariant 2

Both count queries are derived from step.forward by string manipulation of the carried match clause. No OperationSpec is inspected here.