@pythia-software/query-table-core 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,6 +3,10 @@
3
3
  Framework-agnostic query state, schema contracts, filtering, sorting,
4
4
  aggregation, serialization, and transport/storage interfaces for query-table.
5
5
 
6
+ Also exports object property view definitions, normalization/defaults, separate
7
+ property storage adapters, and foreign-key relationship mapping contracts. See
8
+ [object property views](../../docs/object-properties.md).
9
+
6
10
  ## Install
7
11
 
8
12
  ```bash
@@ -40,6 +44,17 @@ Query state is bounded whenever it crosses the library's URL, storage, or
40
44
  server-projection boundaries. SQL expressions remain trusted server-side schema
41
45
  configuration; request values are never SQL fragments.
42
46
 
47
+ ## Compact URLs and query snapshots
48
+
49
+ `encodeQuery` chooses versioned JSON or raw-DEFLATE tokens, packs intact set
50
+ filters once, and shares identical property layouts. `decodeQueryStrict` reports
51
+ invalid/unsupported/oversized links; `decodeQuery` is the tolerant convenience
52
+ decoder. `createQueryLinkService` keeps fitting views inline and oversized views
53
+ in a bounded FIFO browser cache. Its explicit `durable`/`snapshot` calls promote
54
+ immutable codes through an injected `QuerySnapshotStore`; ordinary `local` calls
55
+ never write to the server. `httpQuerySnapshotStore` implements the host REST
56
+ contract. See [URL state and saved-search links](../../docs/url-state-and-saved-search-design.md).
57
+
43
58
  Text filters include `matches_regex` / `not_matches_regex`. An order term may
44
59
  set `extract: { regex: "..." }` to compare the first capture group (or the whole
45
60
  match when there is no capture group); non-matches sort as nulls.
@@ -59,3 +74,61 @@ Exports include `ComputedColumnStore`, `httpComputedColumnStore`, `memoryCompute
59
74
  For case-sensitive array keys, set `filter: { arrayCaseSensitive: true }` on the
60
75
  `textarray` field. The default remains case-insensitive. This setting applies to
61
76
  local filtering and metrics and to PostgreSQL array membership.
77
+
78
+ Datetime comparisons accept signed elapsed offsets such as `-1h`, `+8d2h10m`,
79
+ and `+0s`. Operators and the wire shape are unchanged: values remain relative in
80
+ saved queries and requests, and the server resolves them when compiling. Local
81
+ executors mirror this behavior and accept an optional clock for deterministic
82
+ execution. See [relative datetime operands](https://github.com/Pythia-Software/query-table/blob/main/docs/relative-time.md).
83
+
84
+ ## Local metric resource and precision boundaries
85
+
86
+ `evaluateMetrics` checks grouping storage before serializing each tuple.
87
+ `maxGroupKeyLength` defaults to 65,536 escaped JSON UTF-16 code units per tuple;
88
+ `maxGroupBytes` defaults to 16,000,000 estimated bytes per metric. The byte
89
+ estimate includes serialized keys, original string payloads (charged per group
90
+ even when shared), tuple slots, map/bucket overhead, and 16 bytes per retained
91
+ row reference. It also reserves a candidate group and serialization scratch
92
+ before lookup, including for duplicate keys. These conservative bounds can
93
+ reject a population below its actual heap limit; they are not heap measurements.
94
+ Ungrouped rows also consume the row-reference budget. Bounds must be nonnegative
95
+ safe integers. Exceeding a bound returns an explicit metric error with no partial
96
+ buckets. Existing row, group-count, operation, and distinct-value budgets remain
97
+ independent. Group limits apply after evaluation and do not bypass these bounds.
98
+ Keys preserve scalar types, and long field values remain valid within the tuple
99
+ and byte limits; field values are never truncated.
100
+
101
+ Numeric SUM, AVG, MIN, MAX and numeric COUNT_DISTINCT samples must be finite and,
102
+ when integral, within ±9,007,199,254,740,991. SUM and AVG check each accumulation
103
+ step; aggregate results, consumed worker reductions, and final metric expression
104
+ results follow the same boundary. Unsafe samples fail even when cancellation,
105
+ averaging, or selecting an extremum could produce a safe result. COUNT counts
106
+ presence and does not interpret the input's numeric magnitude. Text/date extrema
107
+ keep their existing semantics. Distribution samples, percentile outputs, box
108
+ summary statistics, and histogram boundaries use the same numeric rule. Invalid
109
+ box samples produce group errors; any invalid histogram sample invalidates the
110
+ shared extent. NULL remains an excluded sample, not an error. Lazy IF/COALESCE
111
+ branches do not observe unused reduction failures; IFERROR can recover from a
112
+ numeric failure.
113
+
114
+ These are IEEE-754 display-arithmetic semantics, **not exact decimal arithmetic**.
115
+ Finite nonintegral values (including small/subnormal values) remain supported;
116
+ floating-point rounding still applies. `coverage: 'exact'` means the complete
117
+ scoped population was processed, not that every arithmetic operation was exact.
118
+ Row-expression arithmetic retains the formula engine's own semantics; these
119
+ checks apply at sample/reduction/result boundaries, not to every intermediate
120
+ formula node.
121
+
122
+ The Go `qt-postgres-v1` profile requires explicit `ExpressionNumeric` bindings and
123
+ restricts nonzero magnitudes to 1e-300–1e100. Its numeric metric sample/reduction/result guards reject unsafe integers, including AVG/MIN/MAX and distributions. COUNT retains presence semantics. It accumulates SUM/AVG through
124
+ PostgreSQL numeric and also conservatively bounds SUM's absolute population sum.
125
+ Do not claim identical acceptance, intermediate overflow, or bit-for-bit numeric
126
+ parity; negotiate the backend profile and compare supported floating results
127
+ with tolerances. The host must enforce the negotiated profile and execution budgets.
128
+
129
+ ## Cell presentation
130
+
131
+ `FieldDef.display` accepts the serializable `CellDisplay` union for JSON, temporal,
132
+ duration, numeric, text, and chip presentation. It is independent of `FieldType`
133
+ and backend query capabilities. `loadSchema` validates display options, and
134
+ codegen preserves them in frontend schemas. See the [cell display guide](../../docs/cell-displays.md).