SurrealDB
SurrealDB Docs Logo

Enter a search query

Enter a search query

Further Surrealism examples

More examples of Surrealism in practice can be seen inside the surrealism repo. They include a more comprehensive demo of the Rust code,

Surrealism Rust code demo

This demo contains more examples of functions and the #[surrealism] attribute. For example, it can be used to rename the file on the SurrealDB side:

#[surrealism(name = "other")] fn can_drive_bla(age: i64) -> bool { age >= 18 }

It can be used to make a function the default, allowing it to be called via the module path alone:

#[surrealism(default)] fn def(age: i64) -> bool { age >= 18 }

CLI examples

This file shows further usage of how the Surrealism CLI can be used to work with Surrealism functions directly as opposed to through a SurrealDB instance.

# See function signature ./surrealism sig --fnc can_drive demo.surli # Run function with argument ./surrealism run --fnc can_drive --arg 17 demo.surli

Build scripts

This folder contains build scripts for the Surrealism CLI and test examples. Cloning the repo and running full.sh is enough to build the CLI and run all the test examples.

Edit this page on GitHub