Celltypeno test imports ittype Cell = string | number | boolean | null;A value of a row.
An ephemeral target (commons data 0025-sql-target): one SQL file made from governance and typed rows, the same bytes every time, committed and diffed in Git, and a database made from it in one transaction.
Celltypeno test imports ittype Cell = string | number | boolean | null;A value of a row.
Rowstypetype Rows = Readonly<Record<string, readonly Readonly<Record<string, Cell>>[]>>;Rows by table, each a record of columns, both by the words of their names.
SizeFindinginterfaceno test imports itinterface SizeFindingOne table that has more rows than a limit.
| Member | Type | What it is |
|---|---|---|
table | string | |
rows | number | |
limit | number |
sizeFindingsconstconst sizeFindings: (build: TargetBuild, limit: number) => readonly SizeFinding[]The tables of a build with more rows than a limit.
| Parameter | What it is |
|---|---|
build | the build |
limit | the most rows a table may have |
Returns: what is over the limit
targetBuildfunctionfunction targetBuild(schema: LogicalSchema, options: TargetOptions): Result<TargetBuild, readonly TargetError[]>Makes a build.
| Parameter | What it is |
|---|---|
schema | the logical schema |
options | the dialect, naming, schema qualifier, extensions and rows |
Returns: the build, or why not
TargetBuildinterfaceinterface TargetBuildA build: what is run, and the text of the file.
| Member | Type | What it is |
|---|---|---|
dialect | Dialect | |
statements | readonly string[] | The statements, in order: the structure, then the rows. |
text | string | The text of the file. |
counts | Readonly<Record<string, number>> | The number of rows of each table, in the order they are written. |
state | string | The hash of the schema's state. |
data | string | The hash of the rows. |
TargetErrortypeno test imports ittype TargetError =
| { readonly kind: "physical"; readonly errors: readonly PhysicalError[] }
| { readonly kind: "un… (678 characters)type TargetError =
| { readonly kind: "physical"; readonly errors: readonly PhysicalError[] }
| { readonly kind: "unknown-table"; readonly table: string }
| { readonly kind: "unknown-column"; readonly table: string; readonly column: string }
| { readonly kind: "missing-required"; readonly table: string; readonly columns: readonly string[]; readonly row: number }
| { readonly kind: "duplicate-key"; readonly table: string; readonly key: readonly Cell[] }
| { readonly kind: "duplicate-column"; readonly table: string; readonly column: string; readonly row: number }
| { readonly kind: "cycle"; readonly tables: readonly string[] }
| { readonly kind: "state" };Why a target cannot be made from its description, as a value.
TargetOptionsinterfaceinterface TargetOptionsWhat a build is made with.
| Member | Type | What it is |
|---|---|---|
dialect | Dialect | |
naming? | Naming | |
schema? | string | The schema the tables are in. |
sources? | readonly StatementSource[] | |
tableClauses? | readonly TableClause[] | |
rows? | Readonly<Record<string, readonly Readonly<Record<string, Cell>>[]>> | The rows. |
module? | string | The module the file was made from, for its header. |
batch? | number | The rows to an INSERT; 100 where it is not said. |