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

ColumnTypeConstraints
idTEXTPRIMARY KEY
entity_typeTEXTNOT NULL
identity_keyTEXTNOT NULL
created_atTEXTNOT 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)
);