You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#2677 adds orderBy to CubeQuery in wren-core, so a cube query can be ranked natively (ORDER BY <ordinal> ASC|DESC) instead of requiring a SQL wrapper. That PR is deliberately scoped to core internals; this issue tracks the WASM/TypeScript consumer surface.
The WASM binding itself needs no change — WrenEngine::cubeQuery takes a JSON string and hands it straight to serde, so orderBy already works at runtime. What is missing is the typed surface: TS callers currently need a cast to pass it.
What to change
core/wren-core-wasm/sdk/src/index.ts:51 — CubeQueryInput has no orderBy. Add it plus the accompanying member/direction types, mirroring the Rust shape:
and orderBy?: CubeOrderByInput[]; on CubeQueryInput.
docs/core/sdk/wasm.md:261 — the CubeQueryInput interface is duplicated verbatim in the docs and has to be updated in lockstep.
core/wren-core-wasm/AGENT_GUIDE.md:152 — the cubeQuery({ ... }) example is the agent-facing description of the input shape; worth showing a ranked query there.
core/wren-core-wasm/examples/cube-explorer.html — the form-driven CubeQuery builder has no ordering control, so the feature is not discoverable from the explorer.
Notes
Semantics to document: member must name a measure, dimension, or time dimension that the query already selects; each member may appear at most once; omitting orderBy (or passing []) preserves the existing default of ordering by the first time dimension.
Context
#2677 adds
orderBytoCubeQueryinwren-core, so a cube query can be ranked natively (ORDER BY <ordinal> ASC|DESC) instead of requiring a SQL wrapper. That PR is deliberately scoped to core internals; this issue tracks the WASM/TypeScript consumer surface.The WASM binding itself needs no change —
WrenEngine::cubeQuerytakes a JSON string and hands it straight to serde, soorderByalready works at runtime. What is missing is the typed surface: TS callers currently need a cast to pass it.What to change
core/wren-core-wasm/sdk/src/index.ts:51—CubeQueryInputhas noorderBy. Add it plus the accompanying member/direction types, mirroring the Rust shape:and
orderBy?: CubeOrderByInput[];onCubeQueryInput.docs/core/sdk/wasm.md:261— theCubeQueryInputinterface is duplicated verbatim in the docs and has to be updated in lockstep.core/wren-core-wasm/AGENT_GUIDE.md:152— thecubeQuery({ ... })example is the agent-facing description of the input shape; worth showing a ranked query there.core/wren-core-wasm/examples/cube-explorer.html— the form-drivenCubeQuerybuilder has no ordering control, so the feature is not discoverable from the explorer.Notes
membermust name a measure, dimension, or time dimension that the query already selects; each member may appear at most once; omittingorderBy(or passing[]) preserves the existing default of ordering by the first time dimension.core/wren-core-py— that binding is also JSON-string based, and feat(core): support ordered cube queries #2677 already covers it with tests.