Dispositiontypeno test imports ittype Disposition = "expressed" | "carried" | "unexpressed";Where an annotation ended.
The normalized projection (commons data 0006-logical): a domain made into a logical schema, one table for each concept and for each open code list, the columns and keys that the attributes and relationships say, the constraints and indexes the vocabularies say, and the names, as lists of words, that 0005-naming says. It returns the schema and a report of the flow, or every error together. A Projection is a value: this is the library's own, and another takes its place.
What the schema cannot express itself, it carries: the annotations of privacy, security, ownership, requirements and the rest stay on the tables and columns that were made from what they were on, so that a layer or an extension below may express them, and the report says so.
Dispositiontypeno test imports ittype Disposition = "expressed" | "carried" | "unexpressed";Where an annotation ended.
FlowEntryinterfaceno test imports itinterface FlowEntryWhat became of one annotation of governance.
| Member | Type | What it is |
|---|---|---|
element | ElementId | |
index | number | The annotation's position among the element's annotations. |
annotation | `${string}.${string}` | |
disposition | Disposition | |
logical | readonly LogicalId[] | The logical elements it became, or that carry it. |
note? | string |
normalizedconstno test imports itconst normalized: ProjectionThe normalized projection, with the library's vocabularies.
normalizedProjectionfunctionfunction normalizedProjection(options?: ProjectionOptions): ProjectionThe normalized projection with its options.
Projectedinterfaceinterface ProjectedA logical schema and the report of the flow of governance into it.
| Member | Type | What it is |
|---|---|---|
schema | LogicalSchema | |
flow | readonly FlowEntry[] |
Projectiontypetype Projection = (domain: Domain) => Result<Projected, readonly ProjectionError[]>;A projection: a value that makes a logical schema from a domain.
ProjectionErrortypeno test imports ittype ProjectionError =
| {
readonly kind: "collision";
readonly what: "table" | "column" | "constraint";
… (512 characters)type ProjectionError =
| {
readonly kind: "collision";
readonly what: "table" | "column" | "constraint";
readonly name: Words;
readonly table?: Words;
readonly first: ElementId;
readonly second: ElementId;
}
| {
readonly kind: "member";
readonly concept: ElementId;
readonly member: string;
readonly why: "unknown" | "not-a-column" | "not-one-column";
}
| { readonly kind: "identity"; readonly concept: ElementId; readonly why: "cycle" };What is wrong with a projection; project returns all of it together.
ProjectionOptionsinterfaceno test imports itinterface ProjectionOptionsWhat a projection may be told besides the domain.
| Member | Type | What it is |
|---|---|---|
carry? | readonly `${string}.${string}`[] | Kinds of annotation, besides the library's own vocabularies', that the schema carries. |
projectDomainfunctionfunction projectDomain(domain: Domain, projection?: Projection): Result<Projected, readonly ProjectionError[]>The logical schema of a domain.
| Parameter | What it is |
|---|---|
domain | the domain |
projection | how to project it; the normalized projection where none is given |
Returns: the schema and the report of the flow, or every error of the projection
referenceWordsfunctionfunction referenceWords(relationship: string, target: string, key: Words): WordsThe words of the column that refers to a column of a target's key (0005-naming FR-003).