Expand description
The query binding (spec/surface/README.md §1): a DataContext over
the store, so the oqx in-memory engine reproduces the whole OQX surface
— roots, intrinsics, reach-through, structural relations, the edge graph,
the row functions — without a bespoke compiler. Port of
packages/core/src/oqx-js/context.ts.
Rows are the store’s raw column objects (blobs as hex) carrying a hidden
tag column (TAG_KEY) naming their target; get routes field /
intrinsic / relation resolution per target, lazily querying the store.
Row functions (text, under, …) arrive as methods on the $self
receiver (see the runner’s AST rewrite), since a free function sees no row.
The tier-3 planner (crate::planner) hands the rows its SQL produced
back through StoreContext::with_rows_root: the context then serves them
as the residual query’s oqx::ROWS_ROOT scan, while every other root,
relation, intrinsic and row function still reaches the store — the
reference’s rowsRoot context option.
Errors travel the engine’s channel: a failure inside a property read or a
row function — the reserved-basename guard, a store failure — is the
Err of get / call_method (an eval-stage OqxError, since oqx
0.13), which aborts the run exactly like a throw from the reference’s
get; the runner maps it to filter_invalid with the same message. The
one seam still without a channel is root (the engine reads a named root
for the top-level source and for a caret that reaches the root scope), so
a store failure during a root scan is kept in StoreContext::take_root_failure
and the runner reports it after the run.
One seam differs from the reference and is bridged here:
- the Rust engine expands
entries(x)in row position itself (never viacall_function), so thefrontmatter/inlinesource handles are materialized eagerly as plain objects — one key per top-level property in key order, valued by the scalar-vs-list rule — instead of the reference’s lazy handle.frontmatter.<k>andentries(frontmatter)read the same values either way.
Structs§
- Semantic
Vec - A query phrase’s embedding: the model whose cache to read and the vector as a float32 little-endian blob.
- Store
Context - The store-backed context for one repo.
Enums§
- Target
- The four scan targets.
Constants§
- TAG_KEY
- The hidden column tagging a store row with its target.
Functions§
- glob_
to_ like - A
*glob as aLIKEpattern withESCAPE '\';escape_backslashalso escapes\(the list surfaces do,withindoes not). - render_
row_ values - §1.4 rows as values (1.2): a store row that surfaces as a VALUE in a result
tree — a nested
collect { }/first { }/single { }with an empty projection, or avaluesitem that is a row — renders as{ id, path }(the target’s id column as a string; the owning document’s path: a docs row’spath, every other row’s__pathjoin column), never the store row. Everything else recurses, dropping the hidden tag asstrip_tags. - strip_
tags - Strip the hidden tag from a value tree (the wire form never carries it).
- target_
of - The tag of a store row, if it is one.