Skip to content
Identity & auth

sessions

Columns

ColumnTypeNullDefaultKeys
iduuid nogen_random_uuid()
PK
dancer_iduuid no—
tokentext no—
unique
created_attimestamp yesnow()
expires_attimestamp no—

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

Keys, constraints & indexes

Unique

  • (token) sessions_token_unique

Indexes

No secondary indexes.

Foreign keys

  • dancer_id → dancers.id
    on delete no action

Used by

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

REST & webhooks

  • GET /api/architecture/admin
  • ANY /mcp
  • ANY /mcp/public

Relations

Rendering diagram…

Diagram source
erDiagram
  dancers {
    uuid id PK
    text email UK
    text neon_auth_id UK
    text username UK
  }
  sessions {
    uuid id PK
    uuid dancer_id FK
    text token UK
  }
  dancers ||--o{ sessions : "dancer_id"

Defined at server/database/schema.ts:69 as sessions.