detectiontextrequiredHow a failure of it is found
Becomes the column detection of stage_contract.
Written at commons/data/models/flow/mod.ts:111
What a stage guarantees to the stage after it, the outcome codes it may give and how its failure is detected: the stage-contract table of a pipeline
Model flow. Written in commons/data/models/flow/mod.ts:102. Identified by stageContractId.
detectiontextrequiredHow a failure of it is found
Becomes the column detection of stage_contract.
Written at commons/data/models/flow/mod.ts:111
graincode of grainrequiredWhat a ledger row of it stands for
Becomes the column grain of stage_contract.
Written at commons/data/models/flow/mod.ts:112
inputGuaranteetextrequiredWhat it may assume of what it is given
Becomes the column input_guarantee of stage_contract.
Written at commons/data/models/flow/mod.ts:108
outputGuaranteetextrequiredWhat it guarantees of what it gives
Becomes the column output_guarantee of stage_contract.
Written at commons/data/models/flow/mod.ts:109
ownertextrequiredWho answers for it
Becomes the column owner of stage_contract.
Written at commons/data/models/flow/mod.ts:110
pipelinetextrequiredThe pipeline it is of
Becomes the column pipeline of stage_contract.
Written at commons/data/models/flow/mod.ts:106
stagecode of stagerequiredstageContractIdidentifierrequiredWhat identifies the contract: its pipeline and stage
Becomes the column stage_contract_id of stage_contract.
Written at commons/data/models/flow/mod.ts:105
Projects to the table stage_contract with the primary key stage_contract_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
detection | text | false | attribute | stageContract.detection |
grain | text | false | attribute | stageContract.grain |
input_guarantee | text | false | attribute | stageContract.inputGuarantee |
output_guarantee | text | false | attribute | stageContract.outputGuarantee |
owner | text | false | attribute | stageContract.owner |
pipeline | text | false | attribute | stageContract.pipeline |
stage | text | false | attribute | stageContract.stage |
stage_contract_id | text | false | attribute | stageContract.stageContractId |
CREATE TABLE IF NOT EXISTS "stage_contract" (
"stage_contract_id" VARCHAR NOT NULL PRIMARY KEY,
"pipeline" VARCHAR NOT NULL,
"stage" VARCHAR NOT NULL,
"input_guarantee" VARCHAR NOT NULL,
"output_guarantee" VARCHAR NOT NULL,
"owner" VARCHAR NOT NULL,
"detection" VARCHAR NOT NULL,
"grain" VARCHAR NOT NULL,
CONSTRAINT "stage_contract_pipeline_stage_uq" UNIQUE ("pipeline", "stage"),
CONSTRAINT "stage_contract_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable')),
CONSTRAINT "stage_contract_grain_ck" CHECK ("grain" IN ('message', 'batch', 'entity'))
);CREATE TABLE IF NOT EXISTS "stage_contract" (
"stage_contract_id" TEXT NOT NULL PRIMARY KEY,
"pipeline" TEXT NOT NULL,
"stage" TEXT NOT NULL,
"input_guarantee" TEXT NOT NULL,
"output_guarantee" TEXT NOT NULL,
"owner" TEXT NOT NULL,
"detection" TEXT NOT NULL,
"grain" TEXT NOT NULL,
CONSTRAINT "stage_contract_pipeline_stage_uq" UNIQUE ("pipeline", "stage"),
CONSTRAINT "stage_contract_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable')),
CONSTRAINT "stage_contract_grain_ck" CHECK ("grain" IN ('message', 'batch', 'entity'))
);CREATE TABLE IF NOT EXISTS "stage_contract" (
"stage_contract_id" TEXT NOT NULL PRIMARY KEY,
"pipeline" TEXT NOT NULL,
"stage" TEXT NOT NULL,
"input_guarantee" TEXT NOT NULL,
"output_guarantee" TEXT NOT NULL,
"owner" TEXT NOT NULL,
"detection" TEXT NOT NULL,
"grain" TEXT NOT NULL,
CONSTRAINT "stage_contract_pipeline_stage_uq" UNIQUE ("pipeline", "stage"),
CONSTRAINT "stage_contract_stage_ck" CHECK ("stage" IN ('received', 'captured', 'parsed', 'mapped', 'validated', 'forwarded', 'dest_verdict', 'usable')),
CONSTRAINT "stage_contract_grain_ck" CHECK ("grain" IN ('message', 'batch', 'entity'))
);Read and written from TypeScript with the types the model gives: import { stageContract } 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 { stageContract } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(stageContract).select((s) => ({ stageContractId: s.stageContract.stageContractId, pipeline: s.stageContract.pipeline })).run(runner);