Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0007-physical FR-014
References for text written by people (commons data 0007-physical FR-014): a query or a transform is SQL a person writes, and the names in it are a schema's, written by the naming layer for a dialect and a schema qualifier. A Refs gives the written, quoted name of a table or a column from the words of its name, and keeps what is not there as an error value, so that a name that does not exist is found when the SQL is made and not when it is run.
Source: commons/data/sql/physical/refs.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.
RefErrortypeno test imports ittype RefError =
| { readonly kind: "unknown-table"; readonly name: string }
| { readonly kind: "unknown-column"; readonly table: string; readonly column: string }
| { readonly kind: "names"; readonly errors: readonly PhysicalError[] };
What is wrong with a name in a text.
function refsOf(schema: LogicalSchema, dialect: Dialect, naming: Naming, inSchema?: string | undefined, relation?: ((name: string) => string | undefined) | undefined): RefsKit
The references of a schema.
| Parameter | What it is |
|---|
schema | the logical schema |
dialect | the dialect |
naming | the case styles |
inSchema | the schema the tables are in, as bind was given it |
relation | what the caller gives for a name that is not a table of the schema (a model of its own), or nothing |
Returns: the references and what they found wrong
Imported by 2 tests of the run (2 passed, 0 failed): the library's results
Refsinterfaceno test imports itinterface Refs
The names of a schema, for the text of a person.
| Member | Type | What it is |
|---|
table | (name: string) => string | The reference to a table, written and qualified, by the words of its name; or what the caller's relation gives for the name. |
column | (table: string, column: string) => string | A column of a table, written and quoted, by the words of both names. |
own | (name: string) => string | A name written by the schema's naming for a table of the caller's own: with the schema's words added where the dialect has no schemas. |
RefsKitinterfaceno test imports itinterface RefsKit
The names a text asked for, and what was wrong with them.
| Member | Type | What it is |
|---|
refs | Refs | |
errors | () => readonly RefError[] | |
used | () => readonly { readonly name: string; readonly via: "relation" | "schema"; }[] | The tables asked for, once each, in the order first asked, with where each came from. |