Skip to content

API surface

The host bindings follow the same conceptual surface while respecting host naming and object ownership.

CapabilityRustPythonNode.jsWASM
Parse scriptParser::parse_allparseparseparse
ValidateParser::parse(_).is_ok()is_validisValidisValid
Tokenizelexer APItokenizetokenizetokenize
Inject policyinject_filterinject_filterinjectFilterinject_filter / Stmt.injectFilter
Explainplanner/runtimeexplainexplainexplain / analyze
Compileplanner/runtimecompile_querycompileQuerycompile
ExecuteExecutor::executeClient.executeClient.executeClient.execute
  1. One statement: the strict single-statement parser.
  2. One script: semicolon-delimited source parsed as one ordered unit.
  3. Host batch: an array of independent statements or scripts.

These are not interchangeable APIs. In particular, an array boundary is owned by the host, while semicolon ordering is part of QQL source.

Python, Node.js, and WASM expose statement handles so a host can parse once, inject policy, set optional shard routing, inspect the AST, and execute the same object. WASM owners must call free() explicitly when they are finished. In addition to toObject/toJSON, the WASM Stmt exposes compileRoute and compileRouteBytes to inspect the compiled REST route of a single owned statement.

Token objects are nearly identical across hosts but differ slightly in shape: the Rust lexer emits { kind, text, span }, the Python and Node bindings emit { kind, text, pos }, and WASM additionally includes end and len.

Execution returns a stable report with aggregate ok, ordered per-operation results, and succeeded/failed counts. on_error / onError selects stop or continue behavior for multi-operation inputs. The WASM Client is REST-only: it compiles to and executes Qdrant REST routes and does not open gRPC connections.