IF Commons GitHub

drill

concept

One drill of a recovery: what was tested (a replay, a rollback or a restore), against which load or scope, how long it took, what it found and the evidence, so that a recovery is shown and not assumed

Model proof. Written in commons/data/models/proof/mod.ts:51. Identified by drillId.

Governance: attributes

afterHashtextoptional

The hash of what was there after

Becomes the column after_hash of drill.

Written at commons/data/models/proof/mod.ts:61

beforeHashtextoptional

The hash of what was there before

Becomes the column before_hash of drill.

Written at commons/data/models/proof/mod.ts:60

drillIdidentifierrequired

What identifies the drill

Becomes the column drill_id of drill.

Written at commons/data/models/proof/mod.ts:54

evidencetextoptional

Where the evidence is kept

Becomes the column evidence of drill.

Written at commons/data/models/proof/mod.ts:62

kindcode of drillKindrequired

What it tested

Becomes the column kind of drill.

Written at commons/data/models/proof/mod.ts:55

outcomecode of drillOutcomerequired

What it found

Becomes the column outcome of drill.

Written at commons/data/models/proof/mod.ts:59

scopetextrequired

What it was done to: a load id, a table or a store

Becomes the column scope of drill.

Written at commons/data/models/proof/mod.ts:56

secondsintegerrequired

How long it took, in whole seconds

Becomes the column seconds of drill.

Written at commons/data/models/proof/mod.ts:58

startedAtinstantrequired

When it began

Becomes the column started_at of drill.

Written at commons/data/models/proof/mod.ts:57

Logical: the table

Projects to the table drill with the primary key drill_id.

ColumnTypeNullRoleFrom
after_hashtexttrueattributedrill.afterHash
before_hashtexttrueattributedrill.beforeHash
drill_idtextfalseattributedrill.drillId
evidencetexttrueattributedrill.evidence
kindtextfalseattributedrill.kind
outcometextfalseattributedrill.outcome
scopetextfalseattributedrill.scope
secondsintegerfalseattributedrill.seconds
started_attimestampfalseattributedrill.startedAt

Physical: SQL

CREATE TABLE IF NOT EXISTS "drill" (
    "drill_id" VARCHAR NOT NULL PRIMARY KEY,
    "kind" VARCHAR NOT NULL,
    "scope" VARCHAR NOT NULL,
    "started_at" TIMESTAMPTZ NOT NULL,
    "seconds" INTEGER NOT NULL,
    "outcome" VARCHAR NOT NULL,
    "before_hash" VARCHAR,
    "after_hash" VARCHAR,
    "evidence" VARCHAR,
    CONSTRAINT "drill_kind_ck" CHECK ("kind" IN ('replay', 'rollback', 'restore')),
    CONSTRAINT "drill_outcome_ck" CHECK ("outcome" IN ('passed', 'failed', 'abandoned'))
);

Physical: the typed table

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

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

const rows = await from(drill).select((s) => ({ drillId: s.drill.drillId, kind: s.drill.kind })).run(runner);

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