21 releases (6 breaking)

new 1.0.0-rc3.1 Jan 25, 2025
1.0.0-rc2 Dec 13, 2024
1.0.0-rc1 Nov 6, 2024
0.12.0 Oct 4, 2024
0.7.3 Nov 8, 2023

#1016 in Database interfaces

Download history 24/week @ 2024-10-08 6/week @ 2024-10-15 7/week @ 2024-10-22 2/week @ 2024-10-29 125/week @ 2024-11-05 7/week @ 2024-11-12 16/week @ 2024-11-19 7/week @ 2024-11-26 13/week @ 2024-12-03 116/week @ 2024-12-10 15/week @ 2024-12-17 6/week @ 2025-01-07 92/week @ 2025-01-14 84/week @ 2025-01-21

182 downloads per month
Used in 4 crates (via spacetimedb-core)

Custom license

145KB
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.

Dependencies

~14MB
~277K SLoC