Tearleads

organization_read_model_groups Client SQLite table

Normalized visible organization group summaries. The state columns are the group's exact policy head, all null for a stateless group. members_state_hash is the state hash of the membership head delivered for the group, null until the groupMemberships lane covers it.

Declared in packages/client-sdk/src/data/sqlite/schema/organizationReadModelSchema.ts

Columns

  • organization_idtext
    • not null

    Organization that owns the group.

  • group_idtext
    • not null

    Group id.

  • sort_orderinteger
    • not null

    Zero-based position in the served group catalog; reads sort by it.

  • nametext
    • not null

    Display name read from the group's verified current policy, or an empty string until read. A local display cache, never sent to the server.

  • created_attext
    • not null

    ISO-8601 time the server created the group.

  • is_builtininteger
    • not null

    True for the reserved Admins group.

  • state_hashtext
    • nullable

    State hash of the group's current policy state.

  • state_versioninteger
    • nullable

    Version number of that policy state.

  • key_epochinteger
    • nullable

    Key epoch of that policy state.

  • key_fingerprinttext
    • nullable

    Hex SHA-256 fingerprint of the group's encapsulation public key at that epoch.

  • member_countinteger
    • nullable

    Member count that policy state commits to; the stored member rows must match it.

  • members_state_hashtext
    • nullable

    State hash of the membership head the groupMemberships lane bound.

Keys and constraints

  • Primary key(organization_id, group_id)

DDL

The statements the client runs to create this table and its indexes.

CREATE TABLE IF NOT EXISTS "organization_read_model_groups" (
  "organization_id" TEXT NOT NULL,
  "group_id" TEXT NOT NULL,
  "sort_order" INTEGER NOT NULL,
  "name" TEXT NOT NULL,
  "created_at" TEXT NOT NULL,
  "is_builtin" INTEGER NOT NULL,
  "state_hash" TEXT,
  "state_version" INTEGER,
  "key_epoch" INTEGER,
  "key_fingerprint" TEXT,
  "member_count" INTEGER,
  "members_state_hash" TEXT,
  PRIMARY KEY ("organization_id", "group_id")
);