What problem does it solve?
Writing SpacetimeDB server modules in Rust requires precise knowledge of the SDK's macros, table attributes, reducer signatures, and context APIs, and small mistakes like missing the Table import or wrong accessor casing cause compile errors.
Core Features & Use Cases
- Table and Schema Definitions: Declare tables with primary keys, auto-increment columns, unique constraints, btree indexes, and migration-safe defaults.
- Reducers and Lifecycle Hooks: Implement reducers, init/client_connected/client_disconnected hooks, scheduled tables, and deterministic RNG and timestamps via ReducerContext.
- Views, Procedures, and HTTP: Build anonymous and per-user views, query-builder views with semijoins, procedures with outbound HTTP, and inbound HTTP routers.
- Use Case: A developer building a multiplayer game backend can define entity tables, connection lifecycle reducers, and scheduled tick timers entirely in Rust using the patterns in this reference.
Quick Start
Write a SpacetimeDB Rust module with a public entity table keyed by Identity and reducers that create entities and add timestamped records for the connected user.