IF Commons GitHub

sql/extensions/target/make

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0025-sql-target FR-004, 0025-sql-target FR-005

Making a database from a build, and keeping the committed file current (commons data 0025-sql-target).

Source: commons/data/sql/extensions/target/make.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.

materializefunction
function materialize(driver: Driver, build: TargetBuild): Promise<Result<number, { readonly kind: "database"; readonly statement: number; readonly message: string; }>>

Makes a database from a build, in one transaction.

ParameterWhat it is
driveran empty database
buildthe build

Returns: the number of statements run, or the database's error

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

Stalenesstypeno test imports it
type Staleness = { readonly stale: false } | { readonly stale: true; readonly line: number; readonly committed: string; readonly made: string };

Whether a committed file is what the source makes.

stalenessfunction
function staleness(committed: string, build: TargetBuild): Staleness

Compares a committed file with what the source makes now.

ParameterWhat it is
committedthe text of the committed file
buildwhat the source makes now

Returns: whether it is current, and where it first differs if not

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

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