Note
Surrealism extensions are written in Rust, compiled to WebAssembly, and loaded into a running SurrealDB instance. This gives you access to the full Rust ecosystem while keeping extensions sandboxed within the database.
Surrealism was built in order to allow users to extend SurrealDB in ways that benefit them, without needing to make any changes to the code of SurrealDB itself. Some potential use cases are:
Adding functions to create fake / mock data for testing.
Accessing functionality in Rust crates that are too specific to merge into SurrealDB itself, such as language-specific functionality, custom case conversions, or quantitative finance.
Anything else you have built in your own code that you would like to access inside SurrealDB.
How Surrealism works
Surrealism works by using the following steps:
The addition of a
surrealism.tomlfile plus the#[surrealism]annotation over functions to expose.A CLI command compiles this code into a WASM binary.
Statements inside SurrealDB to allow access to the file and to define a module holding the functions.

The next page contains a walkthrough to show how this process works.