[rooms] playerdata

This commit is contained in:
Devin Zuczek
2026-09-25 12:17:11 -04:00
parent 9c4c1bdd3a
commit b2942a0a51
5 changed files with 197 additions and 10 deletions
+15
View File
@@ -0,0 +1,15 @@
-- Per-room, per-player variable data — what the client saves through
-- `PUT /rooms/{roomId}/playerdata/me` and reads back from `GET .../playerdata/me`.
--
-- Generated from packages/domain/src/rooms-db.ts (ROOM_SCHEMA_DDL) — keep in sync.
--
-- One row per (room, player). `data` is the client's blob exactly as posted (the `data`
-- form field, a base64 string); the server neither decodes nor validates it, and a
-- re-save overwrites the row in place, so the table holds only each player's latest.
CREATE TABLE IF NOT EXISTS playerdata (
room_id INTEGER NOT NULL,
player_id INTEGER NOT NULL,
data TEXT NOT NULL,
PRIMARY KEY (room_id, player_id)
);