Skip to main content

Module query

Module query 

Source
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§

RecordRow
One stored record, owned (the FFI’s rows JSON).
RecordRowRef
One stored record as a host hands it to the evaluator (borrowed).
RecordsAggregate
name: [op, field?]: a column of every group (and of totals).
RecordsBefore
The rows whose field is before date are left out of the rows and groups, totalled into before and seed every running value.
RecordsContext
What records_value needs besides the rows.
RecordsDay
One day of the month view.
RecordsFilter
One condition: eq / in compare as text, the ranges (between inclusive) as numbers when both sides parse, else as text.
RecordsGroupKey
One group-by key: a field (author = the author, by name), or a date field cut into buckets. The group’s column is named field.
RecordsMonthView
by=<dateField>&month=YYYY-MM: the rows of one month, every day listed.
RecordsQuery
The structured query.
RecordsQueryIssue
A problem with a JSON query, a JSON pointer into it.
RecordsRunning
A cumulative value of field over the groups (or rows, or month days) in order.
RecordsSortKey
RecordsTimelineView
eApps U3: view=timeline: columns periods of scale from the one holding start, the rows grouped by row.
RecordsWeekView
eApps U3: view=week: the Monday-first week holding key.

Enums§

RecordsAggregateOp
RecordsFilterOp
RecordsFilterValue
A condition’s value: one text, or a list (in; between = [low, high]).
RecordsOrder
RecordsRunningOp

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: eq is the bare key, the others a .<op> suffix (in and between take 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 kind with its computed fields written in (None for 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’s now, 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’s queries → the same source with that query, its ${param} templates filled from the other params, as q=<canonical JSON> (a kind param 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 as computed.
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 as refs.
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, the q param) → the query and every problem with it (a problem drops the part, the rest still runs). kind (a source’s own) wins over from.
parse_records_query
Query params (as super::parse_source gives 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 query over rows (every row of the app, any kind): None without a kind; else {rows, count, sum?, month?, groups?, totals?, before?}: the matches sorted (ties by id) then cut at the limit, count and sum before the limit.
records_value_owned
records_value over owned rows (the FFI’s).
shift_month
YYYY-MM ± by months.