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.
function freeze(existing: readonly Artifact[], plan: Freezable, options?: FreezeOptions): Result<readonly Artifact[], readonly FreezeError[]>
The files a plan adds to a history.
| Parameter | What it is |
|---|
existing | the files the history has now |
plan | the plan |
options | the 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 itinterface Freezable
The plan a freeze is given.
| Member | Type | What it is |
|---|
dialect | string | |
from | string | |
to | string | |
steps | readonly Step[] | |
repeatable | readonly Repeatable[] | |
FreezeErrortypeno test imports ittype 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 itinterface FreezeOptions
What a freeze is given besides the plan.
| Member | Type | What it is |
|---|
folder? | string | The folder the files are in; migrations by default. |
state? | unknown | The state the plan ends in, as a value, which is kept beside the steps. |
renderRepeatableconstno test imports itconst renderRepeatable: (r: readonly Repeatable[]) => string
The repeatable objects as the file holds them.