IF Commons GitHub

sql/extensions/safety/quarantine

Written to: 4 requirements: 4 proved, 0 partly, 0 failing, 0 with no test recorded. 0015-sql-safety FR-004, 0015-sql-safety FR-005, 0015-sql-safety FR-006, 0015-sql-safety FR-007

Quarantine (commons data 0015-sql-safety FR-004 to FR-007): a step that drops a column copies its values, with the table's key, to a table of their own first; a step that drops a table renames it away. Either can be undone by the step's down statements, and nothing is destroyed until a person purges the quarantine table.

Source: commons/data/sql/extensions/safety/quarantine.ts

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

purgefunctionno test imports it
function purge(options: PurgeOptions): Result<Plan, readonly { readonly kind: "not-quarantine"; readonly name: string; }[]>

A plan of one step that drops quarantine tables, which a person asks for by name.

ParameterWhat it is
optionswhat to purge

Returns: the plan, or why a name is not a quarantine table

PurgeOptionsinterfaceno test imports it
interface PurgeOptions

What purge is given.

MemberTypeWhat it is
fromstringThe hash of the state the database is in: a purge changes no table of the state.
namesreadonly string[]The names of the quarantine tables to drop, as written.
dialectDialect
settingsSafety
qualifier?stringThe schema the tables are qualified by.
quarantinefunctionno test imports it
function quarantine(settings: Safety): StepTransform

The quarantine transform.

ParameterWhat it is
settingsthe settings

Returns: the transform

quarantineNameconstno test imports it
const quarantineName: (naming: Naming, table: string, column: readonly string[] | undefined, suffix: string) => string

The name of a quarantine table: the table's words, the column's and the suffix, written by the case style.

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