IF Commons GitHub

sql/extensions/idempotency/transform

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0012-sql-idempotency FR-003, 0012-sql-idempotency FR-004, 0012-sql-idempotency FR-005

The idempotency transform (commons data 0012-sql-idempotency FR-003 to FR-005): each statement of a step is written in a form that is safe to run twice. Where the dialect has a natural form (IF NOT EXISTS, IF EXISTS, an upsert) the statement is written in it; where it has none, the statement carries a guard, a query on the catalog that says its work is done; where neither is possible the step is marked as safe only because the ledger runs it at most once. Every step says which.

Source: commons/data/sql/extensions/idempotency/transform.ts

1 of 2 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

idempotencyfunction
function idempotency(settings?: IdempotencySettings): StepTransform

The idempotency transform of a project.

ParameterWhat it is
settingswhat the project says of idempotency

Returns: the transform, to be given to plan or contributed through lifecycle.transform

Imported by 72 tests of the run (72 passed, 0 failed): the library's results

IdempotencySettingsinterfaceno test imports it
interface IdempotencySettings

What a project says of idempotency; what is not said is the default.

MemberTypeWhat it is
mode?"off" | "on"on (the default) makes every step safe to run twice; off leaves the statements as the core wrote them.
unguardable?"allow" | "refuse"What to do with a step that only the ledger keeps from running twice: allow (the default) or refuse.

Titles, headings, exports, tables, columns and requirements. Esc closes.