25 releases (4 stable)

new 1.1.1 Apr 22, 2025
1.0.1 Mar 25, 2025
1.0.0-rc2 Dec 13, 2024
1.0.0-rc1 Nov 6, 2024
0.7.3 Nov 8, 2023

#2423 in Database interfaces

Download history 6/week @ 2025-01-07 92/week @ 2025-01-14 106/week @ 2025-01-21 15/week @ 2025-01-28 12/week @ 2025-02-04 1/week @ 2025-02-11 6/week @ 2025-02-18 137/week @ 2025-02-25 104/week @ 2025-03-04 28/week @ 2025-03-11 7/week @ 2025-03-18 114/week @ 2025-03-25 23/week @ 2025-04-01 21/week @ 2025-04-08 149/week @ 2025-04-15

308 downloads per month
Used in 3 crates (via spacetimedb-core)

Custom license

150KB
3K SLoC

Abstract Virtual Machine for execution of end-user logic

It optimizes the code & include a more general "query planner"

The execution is split in 3 "phases":

1- AST formation

Generate the AST (that could be invalid according to the semantics).

This step is outside the [vm] and can be done, for example, by the SQL layer.

Use [dsl] to build the [expr:Expr] that build the AST.

2- AST validation

Calling eval::optimize verify the code has the correct semantics (ie: It checks types, schemas, functions are valid, etc.), and "desugar" the code in a more optimal form for later execution.

This build expr::Expr that is what could be stored in the database, ie: Is like bytecode.

3- Execution

Run the AST build from expr::Expr. It assumes is correct.


⚠️ Internal Crate ⚠️

This crate is intended for internal use only. It is not stable and may change without notice.

Dependencies

~17MB
~335K SLoC