Skip to main content

Crate helix_ast

Crate helix_ast 

Source
Expand description

Shared Helix query AST.

This crate owns the public JSON contract used by SDKs and the planner. The wire format is an operation tree: each traversal builder call creates one node, and chaining wraps the previous root as that node’s input.

Modules define the stable contract boundaries:

  • value contains JSON/property values and mutation inputs.
  • expr contains predicates, expressions, and stream bounds.
  • traversal contains the operation-tree AST and traversal builders.
  • batch and query contain batch and request wire formats.
use helix_ast::prelude::*;

let query = read_batch()
    .var_as(
        "users",
        g()
            .n_with_label("User")
            .where_(Predicate::eq("username", "alice"))
            .limit(1),
    )
    .returning(["users"]);
let json = sonic_rs::to_string(&query).unwrap();

assert!(json.contains(r#""root":{"limit""#));
assert!(json.contains(r#""input":{"where""#));
assert!(json.contains(r#""eq":{"left":{"property":"username"}"#));

Modules§

batch
expr
graph
index
prelude
Curated query-builder prelude.
projection
query
traversal
Typed traversal states and operations for the public query AST.
value