24 releases (3 stable)

new 1.1.0 Apr 16, 2025
1.0.1 Mar 25, 2025
1.0.0 Feb 28, 2025
1.0.0-rc2 Dec 13, 2024
0.7.3 Nov 8, 2023

#2124 in Database interfaces

Download history 2/week @ 2025-01-03 78/week @ 2025-01-10 23/week @ 2025-01-17 111/week @ 2025-01-24 9/week @ 2025-01-31 8/week @ 2025-02-07 3/week @ 2025-02-14 5/week @ 2025-02-21 178/week @ 2025-02-28 84/week @ 2025-03-07 11/week @ 2025-03-14 95/week @ 2025-03-21 33/week @ 2025-03-28 23/week @ 2025-04-04 115/week @ 2025-04-11

267 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
~332K SLoC