10 unstable releases (3 breaking)

0.9.0 May 2, 2024
0.8.2 Feb 15, 2024
0.8.1 Jan 19, 2024
0.8.0 Dec 9, 2023
0.6.1 Aug 13, 2023

#1082 in Database interfaces

Download history 17/week @ 2024-01-18 118/week @ 2024-02-15 24/week @ 2024-02-22 20/week @ 2024-02-29 11/week @ 2024-03-07 10/week @ 2024-03-14 158/week @ 2024-03-21 19/week @ 2024-03-28 7/week @ 2024-04-04 4/week @ 2024-04-11 12/week @ 2024-04-18 6/week @ 2024-04-25 165/week @ 2024-05-02

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

Custom license

155KB
3.5K 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

~10–17MB
~216K SLoC