sql/extensions/protected-access/mod
Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0014-sql-protected-access FR-001
The protection layer (commons data 0014-sql-protected-access ): the tables in a schema of their own, a view of each in a schema that applications use, and where the engine can enforce it, the rights, the policies and a guard that keep it so. protection gives everything a project passes on: the options of bind, of plan and of execute; protectionExtension contributes the source and the transform through the engine; capabilities says what a dialect can do and what it can only do by convention.
const p = protection ({ tablesSchema: "data" , viewsSchema: "api" });
bind (schema, { dialect, ... p.bind });
plan (from, schema, { dialect, ... p.desired }, { transforms: p.transforms });
execute (plan, driver, dialect, { empty, before: p.session (dialect) });Source: commons/data/sql/extensions/protected-access/mod.ts
3 of 5 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.
Capabilitiesinterface no test imports it interface Capabilities What a dialect can do for the layer.
Member Type What it is enforcedbooleanWhether the layer is enforced (rights, policies, the guard) or a convention. writableViewsbooleanWhether a row can be written through a view. notesreadonly string[]What a person should know, in words.
function capabilities (dialect : Dialect , given ?: ProtectionSettings ): Capabilities What a dialect can do for the layer, for the settings.
Parameter What it is dialectthe dialect givenwhat a project says of protection
Returns: the capabilities
Imported by 10 tests of the run (10 passed, 0 failed): the library's results
ProtectionKitinterface no test imports it interface ProtectionKit Everything a project passes on for a set of settings.
Member Type What it is settingsProtectionbind{ readonly schema: string; readonly sources: readonly StatementSource[]; }What bind is given. desired{ readonly schema: string; readonly sources: readonly StatementSource[]; }What plan is given as the desired state. transformsreadonly StepTransform[]The transforms plan is given. session(dialect: Dialect) => readonly string[]The statements execute runs at the start of each transaction.
function protection (given ?: ProtectionSettings ): ProtectionKit The protection layer for a set of settings.
Parameter What it is givenwhat a project says of protection
Returns: what a project passes on
Imported by 29 tests of the run (29 passed, 0 failed): the library's results
function protectionExtension (given ?: ProtectionSettings , version ?: string ): Result <Extension , IdError >The layer as an extension of the engine, sql.protected-access, which contributes its source and its transform.
Parameter What it is givenwhat a project says of protection versionthe extension's version
Returns: the extension, or why its identifier is not one
Imported by 10 tests of the run (10 passed, 0 failed): the library's results