IF Commons GitHub

sql/extensions/views/view

Written to: 3 requirements: 3 proved, 0 partly, 0 failing, 0 with no test recorded. 0009-sql-features FR-005, 0009-sql-features FR-006, 0009-sql-features FR-007

Views (commons data 0009-sql-features FR-005 to FR-007): a view is derived, so it is not governance; it is made from a typed definition of tables and columns named as governance names them (partyId), written by the case style, and replaced where the dialect can say so or dropped and made again where it cannot.

Source: commons/data/sql/extensions/views/view.ts

1 of 6 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

viewsSourcefunction
function viewsSource(definitions: readonly ViewDefinition[]): StatementSource

The source of the views.

ParameterWhat it is
definitionsthe views, in the order they are made

Returns: a statement source

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

ColumnRefinterfaceno test imports it
interface ColumnRef

A column of a table, as governance names them.

MemberTypeWhat it is
tablestring
columnstring
Conditiontypeno test imports it
type Condition = ColumnRef & ({ readonly is: "null" } | { readonly is: "notNull" } | { readonly equals: Literal });

What a row must meet: a column is null, is not null, or is equal to a literal.

Joininterfaceno test imports it
interface Join

A join to another table, where two columns are equal.

MemberTypeWhat it is
tablestring
onreadonly [ColumnRef, ColumnRef]
ViewColumninterfaceno test imports it
interface ViewColumn extends ColumnRef

A column a view shows, and the name it is shown by where that is not the column's.

MemberTypeWhat it is
as?string
tablestring
columnstring
ViewDefinitioninterfaceno test imports it
interface ViewDefinition

A view.

MemberTypeWhat it is
namestringIts name as governance writes names, lower camel case.
descriptionstring
fromstringThe table it is drawn from.
joins?readonly Join[]
columnsreadonly ViewColumn[]
where?readonly Condition[]

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