calculationtextrequiredThe calculation
Becomes the column calculation of calculation_run.
Written at commons/data/models/proof/mod.ts:74
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.
calculationtextrequiredThe calculation
Becomes the column calculation of calculation_run.
Written at commons/data/models/proof/mod.ts:74
calculationRunIdidentifierrequiredWhat identifies the run
Becomes the column calculation_run_id of calculation_run.
Written at commons/data/models/proof/mod.ts:73
inputHashtextrequiredThe SHA-256 of its inputs
Becomes the column input_hash of calculation_run.
Written at commons/data/models/proof/mod.ts:77
loadIdtextoptionalThe 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
outputHashtextrequiredThe SHA-256 of its outputs
Becomes the column output_hash of calculation_run.
Written at commons/data/models/proof/mod.ts:78
parameterstextoptionalThe parameters it ran with, as JSON
Becomes the column parameters of calculation_run.
Written at commons/data/models/proof/mod.ts:76
ranAtinstantrequiredrowsintegerrequiredHow many rows it gave
Becomes the column rows of calculation_run.
Written at commons/data/models/proof/mod.ts:79
versiontextrequiredIts version
Becomes the column version of calculation_run.
Written at commons/data/models/proof/mod.ts:75
Projects to the table calculation_run with the primary key calculation_run_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
calculation | text | false | attribute | calculationRun.calculation |
calculation_run_id | text | false | attribute | calculationRun.calculationRunId |
input_hash | text | false | attribute | calculationRun.inputHash |
load_id | text | true | attribute | calculationRun.loadId |
output_hash | text | false | attribute | calculationRun.outputHash |
parameters | text | true | attribute | calculationRun.parameters |
ran_at | timestamp | false | attribute | calculationRun.ranAt |
rows | integer | false | attribute | calculationRun.rows |
version | text | false | attribute | calculationRun.version |
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
);CREATE TABLE IF NOT EXISTS "calculation_run" (
"calculation_run_id" TEXT NOT NULL PRIMARY KEY,
"calculation" TEXT NOT NULL,
"version" TEXT NOT NULL,
"parameters" TEXT,
"input_hash" TEXT NOT NULL,
"output_hash" TEXT NOT NULL,
"rows" INTEGER NOT NULL,
"ran_at" TIMESTAMPTZ NOT NULL,
"load_id" TEXT
);CREATE TABLE IF NOT EXISTS "calculation_run" (
"calculation_run_id" TEXT NOT NULL PRIMARY KEY,
"calculation" TEXT NOT NULL,
"version" TEXT NOT NULL,
"parameters" TEXT,
"input_hash" TEXT NOT NULL,
"output_hash" TEXT NOT NULL,
"rows" INTEGER NOT NULL,
"ran_at" TEXT NOT NULL,
"load_id" TEXT
);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);