IF Commons GitHub

calculationRun

concept

One run of a calculation: its name and version, the parameters it ran with, the hash of its inputs and of its outputs and how many rows it gave, so that a figure can be reproduced and a change of one shown

Model proof. Written in commons/data/models/proof/mod.ts:70. Identified by calculationRunId.

Governance: attributes

calculationtextrequired

The calculation

Becomes the column calculation of calculation_run.

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

calculationRunIdidentifierrequired

What identifies the run

Becomes the column calculation_run_id of calculation_run.

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

inputHashtextrequired

The SHA-256 of its inputs

Becomes the column input_hash of calculation_run.

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

loadIdtextoptional

The load it was run for, where it was

Becomes the column load_id of calculation_run.

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

outputHashtextrequired

The SHA-256 of its outputs

Becomes the column output_hash of calculation_run.

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

parameterstextoptional

The parameters it ran with, as JSON

Becomes the column parameters of calculation_run.

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

ranAtinstantrequired

When

Becomes the column ran_at of calculation_run.

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

rowsintegerrequired

How many rows it gave

Becomes the column rows of calculation_run.

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

versiontextrequired

Its version

Becomes the column version of calculation_run.

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

Logical: the table

Projects to the table calculation_run with the primary key calculation_run_id.

ColumnTypeNullRoleFrom
calculationtextfalseattributecalculationRun.calculation
calculation_run_idtextfalseattributecalculationRun.calculationRunId
input_hashtextfalseattributecalculationRun.inputHash
load_idtexttrueattributecalculationRun.loadId
output_hashtextfalseattributecalculationRun.outputHash
parameterstexttrueattributecalculationRun.parameters
ran_attimestampfalseattributecalculationRun.ranAt
rowsintegerfalseattributecalculationRun.rows
versiontextfalseattributecalculationRun.version

Physical: SQL

CREATE TABLE IF NOT EXISTS "calculation_run" (
    "calculation_run_id" VARCHAR NOT NULL PRIMARY KEY,
    "calculation" VARCHAR NOT NULL,
    "version" VARCHAR NOT NULL,
    "parameters" VARCHAR,
    "input_hash" VARCHAR NOT NULL,
    "output_hash" VARCHAR NOT NULL,
    "rows" INTEGER NOT NULL,
    "ran_at" TIMESTAMPTZ NOT NULL,
    "load_id" VARCHAR
);

Physical: the typed table

Read and written from TypeScript with the types the model gives: import { calculationRun } 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 { calculationRun } from "@intellectual-frontiers/data/sql/typed/models";

const rows = await from(calculationRun).select((s) => ({ calculationRunId: s.calculationRun.calculationRunId, calculation: s.calculationRun.calculation })).run(runner);

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