Expand description
Embedded SurrealDB store: durable config only, behind a thin per-table repository.
The store is SurrealDB embedded — the official SDK with a local KV backend, so
conclave serve stays a single self-contained binary with a data directory and no external DB
process (DESIGN.md §15). Store::open uses the pure-Rust SurrealKV backend for persistence;
Store::open_in_memory backs hermetic tests.
There is no ORM: storage records are the SDK’s own typed layer (SurrealValue), and this module
maps between them and the domain types. Only durable config lives here (user, machine,
channel, invite, with the uniqueness constraints from DESIGN.md §15); presence,
subscriptions, permission levels, and the admin allowlist are deliberately not persisted.
Structs§
- Channel
Record - A channel (
nameunique, DESIGN.md §6, §15). Membership (the ACL) is normalized into themembershiptable rather than an embedded array, so concurrent joins insert distinct records instead of contending on one row (PRD-0007 T-003). - Invite
Record - An invite token for a channel (
tokenunique, DESIGN.md §6, §15). - Machine
Record - An enrolled machine keypair under a user (
pubkeyglobally unique;nameunique within the user, DESIGN.md §5, §15). - Store
- The embedded store: a thin typed repository over an embedded
SurrealDBinstance. Cloning yields another handle to the same database (the inner client is a shared handle). - User
Record - A registered account (
usernameunique per server, DESIGN.md §15).