Expand description
The runner (spec/surface/README.md §1.4): parse the source, rewrite the
row functions to $self methods, run it through the engine over the
store context, and shape the engine’s result into the surface’s
OqxResult (lean { id, path, … } hits, keyset paging, the consumer
scalars). Port of packages/core/src/oqx-js/run.ts.
By default the tier-3 planner (crate::planner) pre-filters the scan in
SQL and the in-memory engine finishes the residual over the produced rows;
QueryOptions::in_memory forces the pure in-memory engine (the
differential gate runs every case both ways — a planner must be invisible).
Structs§
- OqxResult
- §1.4
OqxResult. - Query
Options query’s options.
Constants§
- BARE_
NEEDS_ SELECT_ MESSAGE - The
barerefusals (4.2): the same text in both engines. - BARE_
WITH_ VALUES_ MESSAGE - DEFAULT_
LIMIT - The default page size.
- REPO_
REMOVED_ MESSAGE - The
$repoerror (removed in surface 2.0): the same text in both engines. - RESERVED_
ALIAS_ PREFIXES - The runner’s own projection names (
__oqx_id,__oqx_path,__oqx_self,__oqx_value) and the selector compiler’s slots (__omg_sel_<t>_<slot>,crate::select) share two reserved prefixes. A user alias under either would shadow an injected item (select __oqx_id: 1overwrote the hit’sidthrough 4.0) or collide with a slot, so it is refused before anything runs (4.1) — over the query’s own top-level items, the only ones the runner injects beside. The reference’sreservedAlias.
Functions§
- bare_
target_ message - The bare-target error.
depthis the scope depth the name was read at when known statically (the carets in the hint count it);Nonewhen raised at read time by the context, where the hint spells out the rule instead. - check_
bare bare: trueneeds a projection and is not thevaluesform (§1.4, 4.2): without a projection a hit is only its envelope, andvaluesis already the bare-values form. Checked over the resolved query where hits are built (the scalar consumers have no hits and ignorebare), before the engine runs, so the error never depends on the rows and the planned and in-memory paths agree trivially. The reference’sbareMisuse.- check_
reserved_ aliases - Refuse a top-level
selectalias under a reserved prefix. - check_
root_ spellings - The repository is OQX’s root row (
spec/oqx0.18): from a top-level row^docsreaches the documents (one caret per enclosing block, or the absolute0^docs) and^idthe repository id. Two spellings are refused before evaluation, by one walk over the parsed tree, so the error does not depend on which rows the data holds and the planned and in-memory paths agree trivially:$repoanywhere (bare, as a member head,^$repo,0^$repo), and a baredocs/linksat scope depth ≥ 1 — a property read of a row that has none.blocks/nodesare relations of some rows (docs.blocks,docs.nodes,blocks.nodes,section.blocks) and are judged by the context at read time with the same message. A^<target>with more carets than enclosing scopes (^docs count { }at the top level) would read absent and count 0: refused too, naming the bare spelling. Port of the reference’scheckRootSpellings. - collect_
semantic_ phrases - The distinct phrases
semantic("…")names (free calls in the raw parse); empty when the source does not parse. - embed_
phrases - Embed the query’s phrases through the provider: the vectors
semantic(...)ranks by. Without a provider the phrases stay unembedded and the context reportsfilter_invalid(“needs an embedding provider”) when one is reached — after its target check, sosemantic()on nodes names the targets (§9; thequerytool’s pre-check is what reportssemantic_unavailable). - past_
root_ message - The past-the-root error:
^docsat the root scope (more carets than there are enclosing scopes) would read absent and count 0 — refused, naming the bare spelling.levelsis the caret count written. - query
- Run an OQX query against
repo_id(§1.4). - query_
ast - Run an already-parsed query (§1.4) — the AST entry the selector compile
uses (
spec/mutate§11.8: the selector’s tree with the templates’ slot projections appended runs as any query does; the reserved-alias check is the source entry’s, so the appended__omg_sel_*items pass).semanticholds the embedded phrases (embed_phrases);opts.provideris not read here. Unknown names (4.6) default toUnknownNames::Refusehere: this entry’s caller is the write selector, where a name no row carries would select every row; the source entry passesHint. - rewrite_
query - Rewrite every row function in a parsed query to a
$selfmethod call, and root every string literal compared with a path intrinsic — onetransformover the AST (spec/oqx/AST.md§5), every block included. - root_
path_ literals - The literal-rooting rewrite of one expression (see
rewrite_query). - semantic_
phrases_ of collect_semantic_phrasesover a parsed tree.- unknown_
target_ message - The unknown-target error (3.0 name pass): a top-level
from <name>whose name is not one of the five collections would read an absent root and return an empty result — refused instead, naming the collections (in the root object’s order,revisionsthe fifth since 4.7);edges, the links target’s name before 3.0, gets its new name spelled out.