IF Commons GitHub

load

concept

One load: an id given at the first stage and carried on every row and effect it makes, so that it can be traced and undone as one

Model flow. Written in commons/data/models/flow/mod.ts:86. Identified by loadId.

Governance: attributes

loadIdidentifierrequired

What identifies the load

Becomes the column load_id of load.

Written at commons/data/models/flow/mod.ts:89

loadTypecode of loadTyperequired

What kind of load it is

Becomes the column load_type of load.

Written at commons/data/models/flow/mod.ts:90

rolledBackAtinstantoptional

When it was undone, where it was

Becomes the column rolled_back_at of load.

Written at commons/data/models/flow/mod.ts:94

sourcetextrequired

The sender or system it came from

Becomes the column source of load.

Written at commons/data/models/flow/mod.ts:92

startedAtinstantrequired

When it began

Becomes the column started_at of load.

Written at commons/data/models/flow/mod.ts:93

tenanttextoptional

The tenant it is for

Becomes the column tenant of load.

Written at commons/data/models/flow/mod.ts:91

Logical: the table

Projects to the table load with the primary key load_id.

ColumnTypeNullRoleFrom
load_idtextfalseattributeload.loadId
load_typetextfalseattributeload.loadType
rolled_back_attimestamptrueattributeload.rolledBackAt
sourcetextfalseattributeload.source
started_attimestampfalseattributeload.startedAt
tenanttexttrueattributeload.tenant

Physical: SQL

CREATE TABLE IF NOT EXISTS "load" (
    "load_id" VARCHAR NOT NULL PRIMARY KEY,
    "load_type" VARCHAR NOT NULL,
    "tenant" VARCHAR,
    "source" VARCHAR NOT NULL,
    "started_at" TIMESTAMPTZ NOT NULL,
    "rolled_back_at" TIMESTAMPTZ,
    CONSTRAINT "load_load_type_ck" CHECK ("load_type" IN ('delivery', 'backfill', 'incremental', 'replay'))
);

Physical: the typed table

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

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

const rows = await from(load).select((s) => ({ loadId: s.load.loadId, loadType: s.load.loadType })).run(runner);

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