IF Commons GitHub

sql/extensions/history/freeze

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0018-sql-history FR-003, 0018-sql-history FR-004, 0018-sql-history FR-007

Freezing a plan (commons data 0018-sql-history FR-003, FR-004, FR-007): the steps that the history does not hold, as files, with the manifest that chains them, the repeatable objects and the state the history adds up to. A file that is there is never rewritten; a plan that does not start where the history ends is an error value.

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

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

freezefunction
function freeze(existing: readonly Artifact[], plan: Freezable, options?: FreezeOptions): Result<readonly Artifact[], readonly FreezeError[]>

The files a plan adds to a history.

ParameterWhat it is
existingthe files the history has now
planthe plan
optionsthe folder and the state

Returns: the files that are new or changed (the steps that are not frozen yet, the manifest, the repeatable objects and the state), or why not

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

Freezableinterfaceno test imports it
interface Freezable

The plan a freeze is given.

MemberTypeWhat it is
dialectstring
fromstring
tostring
stepsreadonly Step[]
repeatablereadonly Repeatable[]
FreezeErrortypeno test imports it
type FreezeError =
  | { readonly kind: "history"; readonly problems: readonly Problem[] }
  | { readonly kind: "base"; readonly head: string; readonly from: string };

What is wrong with a freeze.

FreezeOptionsinterfaceno test imports it
interface FreezeOptions

What a freeze is given besides the plan.

MemberTypeWhat it is
folder?stringThe folder the files are in; migrations by default.
state?unknownThe state the plan ends in, as a value, which is kept beside the steps.
renderRepeatableconstno test imports it
const renderRepeatable: (r: readonly Repeatable[]) => string

The repeatable objects as the file holds them.

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