identities
One row per person/company
What you'll learn
You're writing SQL that reads identities and need its columns, what each holds, and the DDL as the spec states it.
- every column and its type
- what the object holds and who writes it
- the DDL as the spec states it
A table. One row per person/company; identity_key per SPEC §4.
Columns
| Column | Type | Constraints |
|---|---|---|
id | TEXT | PRIMARY KEY |
entity_type | TEXT | NOT NULL |
identity_key | TEXT | NOT NULL |
created_at | TEXT | NOT NULL |
Table constraints: UNIQUE(entity_type, identity_key).
Definition
From spec/ledger.sql, which is the machine-checkable form of SPEC.md §3:
CREATE TABLE identities (
id TEXT PRIMARY KEY, -- ULID
entity_type TEXT NOT NULL, -- a type file's name (§4a, ADR-054): person | company | post embedded; more arrive with bindings
identity_key TEXT NOT NULL, -- canonical key, see §4
created_at TEXT NOT NULL, -- RFC3339
UNIQUE(entity_type, identity_key)
);