🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

surrealism

by @24601

SurrealDB Surrealism WASM extension development. Write Rust functions, compile to WASM, deploy as database modules. Part of the surreal-skills collection.

⚑ When to Use
TriggerAction
- Fake/mock data generation for testing
- Domain-specific logic (language processing, quantitative finance, custom encoding)
- Access to niche Rust crate functionality too specific for core SurrealDB
- Custom analyzers for full-text search
πŸ’‘ Examples

# Create a new Surrealism project
cargo new --lib my_extension
cd my_extension

Add the WASM target

rustup target add wasm32-unknown-unknown

Create surrealism.toml (required manifest)

cat > surrealism.toml << 'TOML' [package] name = "my_extension" version = "0.1.0" TOML

Write your extension (annotate with #[surrealism])

cat > src/lib.rs << 'RUST' use surrealism::surrealism;

#[surrealism] fn greet(name: String) -> String { format!("Hello, {}!", name) } RUST

Compile to WASM using SurrealDB CLI

surreal module compile

Register in SurrealDB

surreal sql --endpoint http://localhost:8000 --user root --pass root --ns test --db test

-- Grant access to the WASM file
DEFINE BUCKET my_bucket;

-- Register the module functions DEFINE MODULE my_extension FROM 'my_bucket:my_extension.wasm';

-- Use the function in queries SELECT my_extension::greet('World');

βš™οΈ Configuration

  • Rust toolchain (stable) with wasm32-unknown-unknown target
  • SurrealDB CLI v3.0.0+ (surreal binary with surreal module subcommand)
  • Familiarity with SurrealQL DEFINE MODULE and DEFINE BUCKET
  • View on ClawHub
    TERMINAL
    clawhub install surrealism

    πŸ§ͺ Use this skill with your agent

    Most visitors already have an agent. Pick your environment, install or copy the workflow, then run the smoke-test prompt above.

    πŸ” Can't find the right skill?

    Search 60,000+ AI agent skills β€” free, no login needed.

    Search Skills β†’