IF Commons GitHub

freshnessRule

concept

How old the latest load of a source may be before it is stale: the expectation that source freshness is held to

Model operations. Written in commons/data/models/operations/mod.ts:166. Identified by freshnessRuleId.

Governance: attributes

freshnessRuleIdidentifierrequired

What identifies the source

Becomes the column freshness_rule_id of freshness_rule.

Written at commons/data/models/operations/mod.ts:166

maxAgeHoursintegerrequired

How many hours old its latest load may be

Becomes the column max_age_hours of freshness_rule.

Written at commons/data/models/operations/mod.ts:166

ownertextrequired

Who is told when it is stale

Becomes the column owner of freshness_rule.

Written at commons/data/models/operations/mod.ts:166

sourcetextrequired

The source, as a load names it

Becomes the column source of freshness_rule.

Written at commons/data/models/operations/mod.ts:166

Logical: the table

Projects to the table freshness_rule with the primary key freshness_rule_id.

ColumnTypeNullRoleFrom
freshness_rule_idtextfalseattributefreshnessRule.freshnessRuleId
max_age_hoursintegerfalseattributefreshnessRule.maxAgeHours
ownertextfalseattributefreshnessRule.owner
sourcetextfalseattributefreshnessRule.source

Physical: SQL

CREATE TABLE IF NOT EXISTS "freshness_rule" (
    "freshness_rule_id" VARCHAR NOT NULL PRIMARY KEY,
    "source" VARCHAR NOT NULL,
    "max_age_hours" INTEGER NOT NULL,
    "owner" VARCHAR NOT NULL,
    CONSTRAINT "freshness_rule_source_uq" UNIQUE ("source")
);

Physical: the typed table

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

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

const rows = await from(freshnessRule).select((s) => ({ freshnessRuleId: s.freshnessRule.freshnessRuleId, source: s.freshnessRule.source })).run(runner);

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