IF Commons GitHub

sql/extensions/history/package

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0018-sql-history FR-008

The release package (commons data 0018-sql-history FR-008): what a DBA runs with nothing but a SQL client. An installer that runs the steps in one transaction with each guard written in the SQL itself, a preflight that returns a row only if the database is in the state the release needs, a verification of what must be true after it, a back-out that undoes the steps that can be undone in the opposite order, a runbook, and a manifest. Where a guard cannot be written in the dialect's SQL the package is an error value, unless the project allows it to be left out.

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

1 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.

PackageErrortypeno test imports it
type PackageError = { readonly kind: "guard"; readonly step: string; readonly why: string };

What is wrong with a package.

PackageOptionsinterfaceno test imports it
interface PackageOptions

What a package is given besides the steps.

MemberTypeWhat it is
settingsHistory
empty?stringThe hash of the state of an empty database: a release from it has no release before it.
before?readonly string[]Statements run at the start of the transaction, such as the setting that tells a guard a migration is running.
releasePackagefunction
function releasePackage(release: Releasable, dialect: Dialect, options: PackageOptions): Result<readonly Artifact[], readonly PackageError[]>

The release package of a frozen history.

ParameterWhat it is
releasethe steps and the objects that are applied again
dialectthe dialect
optionsthe settings, the empty state and what is run first

Returns: the files, or why a guard cannot be written

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

Releasableinterfaceno test imports it
interface Releasable

What a package is made from.

MemberTypeWhat it is
fromstring
tostring
stepsreadonly FrozenStep[]
repeatablereadonly Repeatable[]

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