Skip to content
Profiles & cities

handles

Handle registry (ADR-004, Step 12). One namespace for dancer and profile URLs: `/@<handle>` resolves through this table. citext for case-insensitive uniqueness. Exactly one of dancer_id / profile_id is set.

Columns

ColumnTypeNullDefaultKeys
handletext no—
PK
dancer_iduuid yes—
profile_iduuid yes—
created_attimestamp yesnow()

Value lists come from .$type<'a' | 'b'>() in the schema — enforced in TypeScript only, not by the database.

Keys, constraints & indexes

Unique

  • (dancer_id) handles_dancer_id_unique
  • (profile_id) handles_profile_id_unique

Indexes

No secondary indexes.

Foreign keys

  • dancer_id → dancers.id
    on delete cascade
  • profile_id → profiles.id
    on delete cascade

Used by

Code that reads or writes this table, found by static analysis of the tRPC routers and API handlers (including helpers they call).

tRPC procedures

No public or signed-in procedure.

REST & webhooks

None.

Relations

Rendering diagram…

Diagram source
erDiagram
  dancers {
    uuid id PK
    text email UK
    text neon_auth_id UK
    text username UK
  }
  handles {
    text handle PK
    uuid dancer_id FK,UK
    uuid profile_id FK,UK
  }
  profiles {
    uuid id PK
    text username UK
  }
  dancers |o--o{ handles : "dancer_id"
  profiles |o--o{ handles : "profile_id"

Defined at server/database/schema.ts:9 as handles.