absencecode of absenceoptionalThe kind of absence a missing value is taken to be
Becomes the column absence of null_rule.
Written at commons/data/models/meaning/mod.ts:116
What a missing value is allowed to be for one field, the kind of absence it stands for and the default where it is replaced: the null policy of a field
Model meaning. Written in commons/data/models/meaning/mod.ts:110. Identified by nullRuleId.
absencecode of absenceoptionalThe kind of absence a missing value is taken to be
Becomes the column absence of null_rule.
Written at commons/data/models/meaning/mod.ts:116
defaultValuetextoptionalThe default, where the policy is to replace
Becomes the column default_value of null_rule.
Written at commons/data/models/meaning/mod.ts:117
nullRuleIdidentifierrequiredWhat identifies the rule: its table and column
Becomes the column null_rule_id of null_rule.
Written at commons/data/models/meaning/mod.ts:113
policycode of nullPolicyrequiredWhat is done with a missing value
Becomes the column policy of null_rule.
Written at commons/data/models/meaning/mod.ts:115
rationaletextrequiredsubjecttextrequiredThe table and column it is about
Becomes the column subject of null_rule.
Written at commons/data/models/meaning/mod.ts:114
Projects to the table null_rule with the primary key null_rule_id.
| Column | Type | Null | Role | From |
|---|---|---|---|---|
absence | text | true | attribute | nullRule.absence |
default_value | text | true | attribute | nullRule.defaultValue |
null_rule_id | text | false | attribute | nullRule.nullRuleId |
policy | text | false | attribute | nullRule.policy |
rationale | text | false | attribute | nullRule.rationale |
subject | text | false | attribute | nullRule.subject |
CREATE TABLE IF NOT EXISTS "null_rule" (
"null_rule_id" VARCHAR NOT NULL PRIMARY KEY,
"subject" VARCHAR NOT NULL,
"policy" VARCHAR NOT NULL,
"absence" VARCHAR,
"default_value" VARCHAR,
"rationale" VARCHAR NOT NULL,
CONSTRAINT "null_rule_subject_uq" UNIQUE ("subject"),
CONSTRAINT "null_rule_policy_ck" CHECK ("policy" IN ('reject', 'allow_absent', 'default_to')),
CONSTRAINT "null_rule_absence_ck" CHECK ("absence" IN ('not_collected', 'not_applicable', 'unknown', 'not_yet_known', 'refused', 'suppressed', 'invalid'))
);CREATE TABLE IF NOT EXISTS "null_rule" (
"null_rule_id" TEXT NOT NULL PRIMARY KEY,
"subject" TEXT NOT NULL,
"policy" TEXT NOT NULL,
"absence" TEXT,
"default_value" TEXT,
"rationale" TEXT NOT NULL,
CONSTRAINT "null_rule_subject_uq" UNIQUE ("subject"),
CONSTRAINT "null_rule_policy_ck" CHECK ("policy" IN ('reject', 'allow_absent', 'default_to')),
CONSTRAINT "null_rule_absence_ck" CHECK ("absence" IN ('not_collected', 'not_applicable', 'unknown', 'not_yet_known', 'refused', 'suppressed', 'invalid'))
);CREATE TABLE IF NOT EXISTS "null_rule" (
"null_rule_id" TEXT NOT NULL PRIMARY KEY,
"subject" TEXT NOT NULL,
"policy" TEXT NOT NULL,
"absence" TEXT,
"default_value" TEXT,
"rationale" TEXT NOT NULL,
CONSTRAINT "null_rule_subject_uq" UNIQUE ("subject"),
CONSTRAINT "null_rule_policy_ck" CHECK ("policy" IN ('reject', 'allow_absent', 'default_to')),
CONSTRAINT "null_rule_absence_ck" CHECK ("absence" IN ('not_collected', 'not_applicable', 'unknown', 'not_yet_known', 'refused', 'suppressed', 'invalid'))
);Read and written from TypeScript with the types the model gives: import { nullRule } from "@intellectual-frontiers/data/sql/typed/models". Generated in commons/data/sql/typed/models/meaning.auto.ts: do not edit.
import { from } from "@intellectual-frontiers/data/sql/typed";
import { nullRule } from "@intellectual-frontiers/data/sql/typed/models";
const rows = await from(nullRule).select((s) => ({ nullRuleId: s.nullRule.nullRuleId, subject: s.nullRule.subject })).run(runner);