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§
- DEFAULT_
LIMIT - The default page size.
- REPO_
REMOVED_ MESSAGE - The
$repoerror (removed in surface 2.0): the same text in both engines.
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_
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/edgesat 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. - 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). - 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).