IF Commons GitHub

sql/extensions/protected-access/view

Written to: 6 requirements: 6 proved, 0 partly, 0 failing, 0 with no test recorded. 0014-sql-protected-access FR-005, 0014-sql-protected-access FR-002, 0014-sql-protected-access FR-003, 0014-sql-protected-access FR-008, 0014-sql-protected-access FR-004, 0014-sql-protected-access FR-011

The view of a table (commons data 0014-sql-protected-access FR-002 to FR-005, FR-008, FR-011): its name and columns, what governance says must be hidden in it, the old name of a column that was renamed, its comment, the rights of the roles that read and write it and, where the engine has no updatable views, the triggers that make it writable. It is written from a plain description of the table, so that it is the same whether it is made with the schema or around a step that changes the table.

Source: commons/data/sql/extensions/protected-access/view.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.

viewNameconstno test imports it
const viewName: (t: { readonly words: readonly string[]; }, naming: Naming) => string

The name of a view: the table's own, written without the schema's words.

viewRefconstno test imports it
const viewRef: (t: { readonly words: readonly string[]; }, c: ViewContext) => string

The reference to a view, qualified by the schema of the views where the dialect has schemas.

viewStatementsfunctionno test imports it
function viewStatements(t: ViewTable, c: ViewContext): { readonly statements: readonly Statement[]; readonly errors: readonly PhysicalError[]; }

The statements that make a view, in the order they are run: it is dropped, made again, described and granted.

ParameterWhat it is
tthe table
cwhat the view is made with

Returns: the statements, or what the dialect cannot write

ViewTableinterfaceno test imports it
interface ViewTable

A table as the view is made from it.

MemberTypeWhat it is
wordsreadonly string[]
namestringThe table's name as written, with the schema's words where the dialect has no schemas.
qualifierstring | undefinedThe schema the table is qualified by, where the dialect has schemas.
columnsreadonly { readonly name: string; readonly words: readonly string[]; readonly type: string; }[]
primaryKeyreadonly string[]The written names of the primary key's columns.
commentstring
ofreadonly LogicalId[]What the statements are made from, so that the lifecycle applies them again when a step changes it.

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