Expand description
VAPP-189 (S1): THE records query, the Rust twin of
packages/exponential-ui/src/host/query.ts, locked by
fixtures/records-query.json (parseCases, sourceCases, jsonCases,
valueCases, expandCases; bucketCases lock crate::dates). A
binding’s URL sugar (records:<kind>?q) parses INTO the structured
RecordsQuery; records_value evaluates it over the rows of any
store. The desktop host calls it directly; the Swift and Compose SDKs
reach it through exponential-ui-ffi (parse_records_query_json,
parse_records_json, parse_records_source_json, records_value_json).
VAPP-190 (Q1): the JSON form (parse_records_json, a package’s
queries, the q=<json> param): group (any field, author, date
buckets), aggregate, running, before, in / between and or.
Structs§
- Record
Row - One stored record, owned (the FFI’s rows JSON).
- Record
RowRef - One stored record as a host hands it to the evaluator (borrowed).
- Records
Aggregate name: [op, field?]: a column of every group (and oftotals).- Records
Before - The rows whose
fieldis beforedateare left out of the rows and groups, totalled intobeforeand seed every running value. - Records
Context - What
records_valueneeds besides the rows. - Records
Day - One day of the month view.
- Records
Filter - One condition:
eq/incompare as text, the ranges (betweeninclusive) as numbers when both sides parse, else as text. - Records
Group Key - One group-by key: a field (
author= the author, by name), or a date field cut into buckets. The group’s column is namedfield. - Records
Month View by=<dateField>&month=YYYY-MM: the rows of one month, every day listed.- Records
Query - The structured query.
- Records
Query Issue - A problem with a JSON query, a JSON pointer into it.
- Records
Running - A cumulative value of
fieldover the groups (or rows, or month days) in order. - Records
Sort Key - Records
Timeline View - eApps U3:
view=timeline:columnsperiods ofscalefrom the one holdingstart, the rows grouped byrow. - Records
Week View - eApps U3:
view=week: the Monday-first week holdingkey.
Enums§
- Records
Aggregate Op - Records
Filter Op - Records
Filter Value - A condition’s value: one text, or a list (
in;between= [low, high]). - Records
Order - Records
Running Op
Constants§
- RECORDS_
AGGREGATE_ OPS - RECORDS_
AGGREGATE_ RESERVED - Names an aggregate may not take (a group’s and a total’s own keys).
- RECORDS_
COMPUTED_ MAX - VAPP-214 (Q3): at most this many computed fields per kind.
- RECORDS_
COMPUTED_ ROW_ KEYS - The row keys a computed field reads next to its kind’s fields (
author, a name, never). - RECORDS_
FILTER_ OPS - The filter operators:
eqis the bare key, the others a.<op>suffix (inandbetweentake comma-separated values). - RECORDS_
LIMIT_ DEFAULT - RECORDS_
LIMIT_ MAX - RECORDS_
MONTHS - RECORDS_
OP_ ALIASES - The JSON form’s spellings of the operators.
- RECORDS_
ORDER_ DEFAULT - RECORDS_
RESERVED_ PARAMS - Query keys with a meaning of their own; never a field filter.
- RECORDS_
ROW_ KEYS - The keys every value row carries next to its data (a data key never shadows one).
- RECORDS_
RUNNING_ OPS - RECORDS_
SCHEME - The binding scheme:
records:<kind>[?query]. - RECORDS_
SORT_ DEFAULT - The URL sugar’s defaults and caps (catalog/host.json
package.records.query). - RECORDS_
WEEKDAYS - The month view’s names (en-US, the same ×4).
Functions§
- computed_
data - VAPP-214 (Q3): the data of every row of
kindwith its computed fields written in (Nonefor other kinds’ rows: they stay as they are). A field reads the row’s data and the row keys by name (a missing one = null); it never reads another computed field (the checker refuses it). A failing or unparsable expression reads null. Evaluated in UTC with the query’snow, like the query’s own buckets. Never stored. - expand_
query_ source - VAPP-190: a package binding
<scheme>:<name>?query=<id>&<params>naming one of the package’squeries→ the same source with that query, its${param}templates filled from the other params, asq=<canonical JSON>(akindparam stays). Anything else is returned as written. - fill_
query_ templates ${name}in every string of a JSON query →params[name](“” when unset).- kind_
computed - VAPP-214 (Q3): a package’s computed fields of
kind(records.<kind>.computed, the string ones);None= none. What a host passes ascomputed. - kind_
refs - eApps R5 (VAPP-219): a package’s refs of
kind(records.<kind>.refs, the well-formed ones);None= none. What a host passes asrefs. - month_
days - Every day of
key(YYYY-MM), empty. - month_
label October 2026.- parse_
records_ json - VAPP-190: the JSON form (a package’s
queries, theqparam) → the query and every problem with it (a problem drops the part, the rest still runs).kind(a source’s own) wins overfrom. - parse_
records_ query - Query params (as
super::parse_sourcegives them) → the query.kind= the source’s own name (records:<kind>). Unknown keys are field filters. VAPP-190:q=<json>= the JSON form (parse_records_json; the other params are ignored). - parse_
records_ source records:<kind>?…→ the query;None= not a records source.- records_
value - The value a records binding emits for
queryoverrows(every row of the app, any kind):Nonewithout a kind; else {rows, count, sum?, month?, groups?, totals?, before?}: the matches sorted (ties by id) then cut at the limit,countandsumbefore the limit. - records_
value_ owned records_valueover owned rows (the FFI’s).- shift_
month YYYY-MM±bymonths.