db: sql.js/Drizzle connection + atomic persist (empty schema)

Flight-Ops plumbing minus game code: in-memory WASM DB, persist() via tmp+rename,
globalThis singleton. Schema is empty at scaffold stage; _meta plumbing table stamps
created_at on first open so the ./db volume holds a valid SQLite file from boot
(a brand-new sql.js database exports as zero bytes). instrumentation.ts opens it at
server start behind a runtime-guarded dynamic import (keeps node:fs out of the Edge
instrumentation bundle).
This commit is contained in:
2026-09-28 15:56:34 +00:00
parent 323b00d692
commit d0f52133f0
4 changed files with 142 additions and 0 deletions
+6
View File
@@ -0,0 +1,6 @@
// Drizzle schema for game state. EMPTY on purpose at scaffold stage (v0.1.0) — no game
// tables yet; the first turn-engine/ship/crew tables land with the first game systems.
// Column names/types here are the source of truth; matching CREATE TABLE statements live
// in lib/db/client.ts (DDL) and must stay in sync with this file.
export {};