You do not have to author Rust yourself to benefit from Surrealism. Many teams consume a pre-built .surli archive produced by another team or pipeline. Authoring a module means writing Rust, configuring surrealism.toml, and running surreal module yourself. This page focuses on the consumer workflow.
Storing the module archive
SurrealDB needs access to the .surli binary. Use DEFINE BUCKET to create or configure bucket storage, then upload the .surli file according to your environment’s path and permissions model.
Registering the module
Once the binary is stored, DEFINE MODULE associates that artefact with a module name and exposes the compiled functions to SurrealQL. The module definition must line up with the exported function names and signatures from the build.
Inspecting exports before use
If you receive a module from another team, inspect it locally before upload:
These commands let you verify function signatures and metadata (such as writeable/comment annotations) before registration.
Calling functions from SurrealQL
After the module is defined, call its exported functions by qualifying the function with the registered module path. Consult your module’s documentation for exact names and parameters.
If you upgrade the module archive, repeat upload and module definition steps (or your deployment automation) so the running instance picks up the new build.
Further reading
Surrealism overview — how compilation, buckets, and modules fit together.
DEFINE BUCKETreference — file storage for WASM.DEFINE MODULEreference — registering Surrealism functions.