Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0007-physical FR-003, 0007-physical FR-005, 0007-physical FR-007
How a logical schema is written (commons data 0007-physical): the names of its tables, columns and constraints as a case style writes them, and the text of what goes into a table (a column with its type, nullability and default, a foreign key, a unique, a check). bind makes CREATE TABLE of them and the lifecycle makes ALTER TABLE of them, so that a column is written one way wherever it is written.
Source: commons/data/sql/physical/express.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.
Expressorinterfaceno test imports itinterface Expressor
What writes the parts of a table.
| Member | Type | What it is |
|---|
list | (words: readonly Words[]) => string | A list of columns, each written and quoted. |
defaultOf | (d: LogicalDefault) => string | |
checkOf | (c: Check) => string | undefined | The text of a check's condition, or none where the dialect cannot say it (an error is then added). |
columnLine | (t: Table, c: Column, inlineKey?: boolean | undefined) => string | A column as a line of CREATE TABLE or of ADD COLUMN: its name, type, NOT NULL, default and, where it is the whole key and inlineKey is true, PRIMARY KEY. |
fkClause | (f: ForeignKey) => string | |
uniqueClause | (u: Unique) => string | |
checkClause | (c: Check) => string | undefined | |
expressorfunctionno test imports itfunction expressor(dialect: Dialect, naming: Naming, names: Names, errors: PhysicalError[]): Expressor
The writer of the parts of a table.
| Parameter | What it is |
|---|
dialect | the dialect |
naming | the case styles |
names | the written names |
errors | where what the dialect cannot express is added |
Returns: the writer
Namesinterfaceno test imports itinterface Names extends Written
The names of a schema as they are written, once, with what is wrong with them.
| Member | Type | What it is |
|---|
qualifier | string | undefined | The schema tables are qualified by, where the dialect has schemas and a schema was given. |
refWords | (table: Words) => string | The reference to a table by the words of its name. |
tables | ReadonlyMap<LogicalId, string> | |
columns | ReadonlyMap<LogicalId, string> | |
constraints | ReadonlyMap<LogicalId, string> | |
ref | (id: LogicalId) => string | The reference to a table of the schema, quoted and qualified (0013-sql-qualified-names FR-004). |
qualify | (name: string) => string | The reference to a table of an extension, by the bare name it is written by: qualified, or with the schema's words added where the dialect has no schemas. |
tableName | (name: string) => string | The name a table of an extension is written by once the schema's words are added where the dialect has no schemas. |
table | (id: LogicalId) => string | undefined | |
column | (id: LogicalId) => string | undefined | |
constraint | (id: LogicalId) => string | undefined | |
writeNamesfunctionno test imports itfunction writeNames(schema: LogicalSchema, dialect: Dialect, naming: Naming, errors: PhysicalError[], inSchema?: string | undefined): Names
Writes every name of a schema, and says which are too long or alike.
| Parameter | What it is |
|---|
schema | the logical schema |
dialect | the dialect, for the longest a name may be |
naming | the case styles |
errors | where what is wrong is added |
inSchema | the schema the tables are in: qualified where the dialect has schemas, else its words come first in each table's name |
Returns: the names