More examples of Surrealism in practice can be seen inside the surrealism repo. They include a more comprehensive demo of the Rust code,
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:
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:
fn def(age: i64) -> bool { age >= 18 }
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
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.