IF Commons GitHub

variance

concept

A known difference between a source and the canonical form, with who decided to live with it and when that ends: a variance is accepted for a time and then expires

Model meaning. Written in commons/data/models/meaning/mod.ts:92. Identified by varianceId.

Governance: attributes

decidedAtinstantoptional

When it was decided

Becomes the column decided_at of variance.

Written at commons/data/models/meaning/mod.ts:101

decidedBytextoptional

Who decided to accept it

Becomes the column decided_by of variance.

Written at commons/data/models/meaning/mod.ts:100

descriptiontextrequired

What differs, in a sentence

Becomes the column description of variance.

Written at commons/data/models/meaning/mod.ts:97

expiresAtinstantoptional

When the acceptance ends

Becomes the column expires_at of variance.

Written at commons/data/models/meaning/mod.ts:102

ownertextrequired

Who answers for it

Becomes the column owner of variance.

Written at commons/data/models/meaning/mod.ts:99

statuscode of varianceStatusrequired

Where it is

Becomes the column status of variance.

Written at commons/data/models/meaning/mod.ts:98

subjecttextrequired

The source and field it is about

Becomes the column subject of variance.

Written at commons/data/models/meaning/mod.ts:96

varianceIdidentifierrequired

What identifies the variance

Becomes the column variance_id of variance.

Written at commons/data/models/meaning/mod.ts:95

Logical: the table

Projects to the table variance with the primary key variance_id.

ColumnTypeNullRoleFrom
decided_attimestamptrueattributevariance.decidedAt
decided_bytexttrueattributevariance.decidedBy
descriptiontextfalseattributevariance.description
expires_attimestamptrueattributevariance.expiresAt
ownertextfalseattributevariance.owner
statustextfalseattributevariance.status
subjecttextfalseattributevariance.subject
variance_idtextfalseattributevariance.varianceId

Physical: SQL

CREATE TABLE IF NOT EXISTS "variance" (
    "variance_id" VARCHAR NOT NULL PRIMARY KEY,
    "subject" VARCHAR NOT NULL,
    "description" VARCHAR NOT NULL,
    "status" VARCHAR NOT NULL,
    "owner" VARCHAR NOT NULL,
    "decided_by" VARCHAR,
    "decided_at" TIMESTAMPTZ,
    "expires_at" TIMESTAMPTZ,
    CONSTRAINT "variance_status_ck" CHECK ("status" IN ('open', 'accepted', 'resolved', 'expired'))
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { variance } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/meaning.auto.ts: do not edit.

import { from } from "@intellectual-frontiers/data/sql/typed";
import { variance } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(variance).select((s) => ({ varianceId: s.variance.varianceId, subject: s.variance.subject })).run(runner);

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