IF Commons GitHub

sql/extensions/history/replay

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0018-sql-history FR-005, 0018-sql-history FR-006

Replaying a history (commons data 0018-sql-history FR-005, FR-006): the manifest and every file are checked, then what the files say is run through the lifecycle's run, with its ledger, its transactions, its checks, its guards and its base, so that replaying the files is running the plan they were frozen from.

Source: commons/data/sql/extensions/history/replay.ts

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

historyPlanfunction
function historyPlan(files: readonly Artifact[], folder?: string): Result<RunPlan & { readonly dialect: string; }, readonly ReplayError[]>

The plan a history holds.

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

replayfunction
function replay(files: readonly Artifact[], driver: Driver, dialect: Dialect, options: RunOptions & { readonly folder?: string | undefined; }): Promise<Result<Applied, readonly ReplayError[]>>

Replays a history on a database.

ParameterWhat it is
filesthe files of the history
driverthe database
dialectits dialect
optionswhat the run is given, and the folder

Returns: what was applied, or why not

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

ReplayErrortypeno test imports it
type ReplayError = { readonly kind: "history"; readonly problems: readonly Problem[] } | { readonly kind: "empty" } | RunError;

What is wrong with a replay.

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