SurrealDB
SurrealDB Docs Logo

Enter a search query

Enter a search query

Note

Surrealism is currently in active development and is not yet stable. We are looking forward to any and all feedback on the plugin system, either via raising an issue or PR on the SurrealDB repo, or anywhere else in the SurrealDB community.

Surrealism

Surrealism is a plugin feature introduced in SurrealDB 3.0 which allows users to write code that can then be compiled to Web Assembly and accessed inside a running SurrealDB instance.

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:

How Surrealism works

Surrealism works by using the following steps:

  • The addition of a surrealism.toml file plus the #[surrealism] annotation over functions to expose.
  • A CLI that compiles this code into a WASM binary.
  • Statements inside SurrealDB to allow access to the file and to define a module holding the functions.

A flowchart showing the steps involved to turn regular Rust code into a compiled WASM binary that can be accessed from a running SurrealDB instance.

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

Edit this page on GitHub