spacetimedb_vm/
lib.rs

1//! Abstract Virtual Machine for execution of end-user logic
2//!
3//! It optimizes the code & include a more general "query planner"
4//!
5//! The execution is split in 3 "phases":
6//!
7//! 1- AST formation
8//!
9//! Generate the AST (that could be invalid according to the semantics).
10//!
11//! This step is outside the [vm] and can be done, for example, by the SQL layer.
12//!
13//! Use [dsl] to build the [expr:Expr] that build the AST.
14//!
15//! 2- AST validation
16//!
17//! Calling [eval::optimize] verify the code has the correct semantics (ie: It checks types, schemas, functions are valid, etc.),
18//! and "desugar" the code in a more optimal form for later execution.
19//!
20//! This build [expr::Expr] that is what could be stored in the database, ie: Is like bytecode.
21//!
22//! 3-  Execution
23//!
24//! Run the AST build from [expr::Expr]. It assumes is correct.
25//!
26
27pub use spacetimedb_lib::operator;
28
29pub mod errors;
30pub mod eval;
31pub mod expr;
32pub mod iterators;
33pub mod ops;
34pub mod program;
35pub mod rel_ops;
36pub mod relation;