spacetimedb-rust

Build SpacetimeDB server logic in Rust compiled to WASM.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/lioartoil/claude-code-handbook --skill spacetimedb-rust-lioartoil
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: spacetimedb-rust
Source: https://github.com/lioartoil/claude-code-handbook/tree/main/skills/spacetimedb-rust
Command: npx skills add https://github.com/lioartoil/claude-code-handbook --skill spacetimedb-rust-lioartoil

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Write robust, WASM-capable Rust modules that run inside the SpacetimeDB runtime, enabling server-side logic, data models, and migrations for scalable database applications.

Core Features & Use Cases

  • Define tables with #[table] attributes to model data
  • Implement reducers to perform transactional mutations
  • Leverage lifecycle hooks, scheduling, event tables, views, and procedures to build production-grade modules
  • Manage migrations and safe evolution of schemas within SpacetimeDB deployments

Quick Start

Install the Rust module, write your SpacetimeDB logic in Rust, and deploy it as a WASM module.

Frequently Asked Questions about spacetimedb-rust

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build server-side logic for SpacetimeDB in Rust?

To build SpacetimeDB modules in Rust, you write server-side logic using the spacetimedb crate, define tables with #[table] attributes, and compile the code to WASM to run inside the database runtime.

What are reducers in SpacetimeDB and how do they work?

Reducers in SpacetimeDB are functions you implement in Rust to perform transactional mutations on your data tables, ensuring state changes execute safely within the database runtime.

Do I need WASM compilation to deploy SpacetimeDB modules?

Yes, you need WASM compilation. SpacetimeDB modules require Rust tooling and the spacetimedb crate to compile your server-side logic into WASM before integrating with the runtime.

Can I manage database schema migrations within SpacetimeDB?

Yes, you can manage migrations and safely evolve schemas within SpacetimeDB deployments by leveraging Rust module features to handle data model changes over time.

What lifecycle hooks and scheduling features does SpacetimeDB support?

SpacetimeDB supports leveraging lifecycle hooks, scheduling, event tables, and views within your Rust modules to build production-grade database applications.

How do I define tables when building a SpacetimeDB Rust module?

You define tables in a SpacetimeDB Rust module by applying #[table] attributes to your Rust structs, modeling the data that the WASM runtime will manage transactionally.