SurrealDB extensions remain an experimental functionality under active development. This guide describes SurrealDB 4.0, and notes where earlier versions differ. A server runs extensions only when the surrealism experimental capability is allowed, for example with --allow-experimental surrealism. Version 3.1.0 made many additions to the core functionality of extensions. We look forward to feedback on the extension system, either via raising an issue or PR on the SurrealDB repo, or on our Discord server - the #surrealism channel is a good place to start.
SurrealDB's extension system, known as Surrealism, lets you add custom functionality to the database engine without modifying its core. Before SurrealDB 4.0, extensions were called modules. Extensions are compiled to WebAssembly (WASM) and loaded at runtime, which means they run in a sandboxed environment with predictable performance characteristics.
This section covers:
Extensions - an overview of the extension architecture, how extensions are discovered and loaded, and the types of extensions you can create.
Guides - step-by-step walkthroughs for creating custom extensions, understanding how extensions run, and installing pre-built ones.
Attribute reference - options for the
#[surrealism]attribute used to mark functions as extensions functions, such ascomment,init, database access through aTransaction, and namespaced exports.
Guides
Using SurrealDB extensions - load and call a compiled extension