IF Commons GitHub

sql/extensions/plan-report/report

Written to: 2 requirements: 2 proved, 0 partly, 0 failing, 0 with no test recorded. 0016-sql-plan-report FR-001, 0016-sql-plan-report FR-008

The plan report (commons data 0016-sql-plan-report): what a plan does, in the words of governance. It is made from a plan and the logical schemas before and after it, and is the same text every time: a summary, a table of steps with the lock each takes, what governance says of what each step touches, what governance itself changes, who has to approve and why, and what is new.

Source: commons/data/sql/extensions/plan-report/report.ts

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

reportArtifactsfunction
function reportArtifacts(input: ReportInput): readonly Artifact[]

The report as files: Markdown and JSON.

ParameterWhat it is
inputwhat the report is made from

Returns: the two files

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

reportDatafunction
function reportData(input: ReportInput): ReportData

The report of a plan, as data.

ParameterWhat it is
inputthe plan, the schemas, the dialect and the settings

Returns: the report

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

reportMarkdownfunction
function reportMarkdown(d: ReportData): string

The report as Markdown.

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

Approverinterfaceno test imports it
interface Approver

A role that has to approve a step, and why.

MemberTypeWhat it is
rolestring
becausestring
ElementGovernanceinterfaceno test imports it
interface ElementGovernance

What governance says of one element a step is made from.

MemberTypeWhat it is
elementstring
personal?{ readonly category?: string | undefined; readonly class?: string | undefined; readonly purposes: readonly string[]; }
classification?string
access?{ readonly read: readonly string[]; readonly write: readonly string[]; }
scope?string
mask?string
retentionDays?number
citesreadonly string[]
GovernanceChangeinterfaceno test imports it
interface GovernanceChange

A change of what governance says.

MemberTypeWhat it is
elementstring
annotationstring
change"added" | "changed" | "removed"
before?unknown
after?unknown
ReportDatainterfaceno test imports it
interface ReportData

The report as data.

MemberTypeWhat it is
domainstring
dialectstring
fromstring
tostring
counts{ readonly steps: number; readonly byClass: Readonly<Record<string, number>>; readonly byReversibility: Readonly<Record<string, number>>; readonly byIdempotency: Readonly<Record<string, number>>; }
stepsreadonly StepReport[]
governanceChangesreadonly GovernanceChange[] | nullWhat governance changes between the schemas; none where the schema before was not given.
addedreadonly { readonly element: string; readonly description: string; }[]
approvalsreadonly { readonly role: string; readonly steps: readonly number[]; }[]
ReportInputinterfaceno test imports it
interface ReportInput

What a report is made from.

MemberTypeWhat it is
planPlan
before?LogicalSchemaThe logical schema the database was made from; none for an empty database or where it is not known.
afterLogicalSchema
dialectDialect
naming?Naming
settings?ReportSettings
StepReportinterfaceno test imports it
interface StepReport

What the report says of one step.

MemberTypeWhat it is
numbernumber
namestring
kindstring
keystring
classstring
why?string
reversibilitystring
idempotency?string
lockstring
elementsreadonly ElementGovernance[]
approversreadonly Approver[]

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