@stackone/olap 3.3.1 → 3.4.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
@@ -246,3 +246,16 @@ keep their keys, strings stay strings, scalars are untouched.
246
246
 
247
247
  A log that cannot be serialized at all — one carrying a value `JSON.stringify` refuses, such as a
248
248
  BigInt — is stored with its payload fields dropped and its envelope intact, rather than being lost.
249
+
250
+ ## Log query conditions
251
+
252
+ `Query.conditions` filters the logs list, count, aggregation, dimensions and last-log queries, before pagination. Each condition names an allow-listed snake-case field, an operator from `LOG_QUERY_OPERATORS` and string `values`. Conditions are ANDed. `eq` matches any of its values and `ne` matches none of them; `eq` never matches a missing (NULL) value and `ne` keeps rows where the field is NULL; an empty string is a value like any other. The comparisons `gt`, `gte`, `lt` and `lte` take one number for `status_code` or `duration_ms`, and never match a missing value; a range is two of them, such as `gte` 1000 and `lt` 5000. `status_code` takes whole numbers, as the Int16 it is stored as; a class such as `4xx` is query-language shorthand for callers to expand into the codes it covers. `session_auth_id` matches only `SESSION_TOKEN` credentials.
253
+
254
+ The limits are 50 conditions, 500 values per condition and 2,048 characters per value. `parseLogQueryConditions` checks them, with the field allow-list and the operators' rules, and throws `InvalidLogQueryConditionsError`, whose `issues` name each failing condition and why, ready for a 400. The logs, last-log, aggregation and dimensions readers run the same check before anything else, so an invalid condition is rejected as invalid, rather than as `QueryClientNotConfiguredError`, where ClickHouse is not configured. A query that ClickHouse itself refuses, such as one whose bound values exceed its 128 KiB parameter limit, rejects with ClickHouse's error rather than returning an empty result.
255
+
256
+ ## When a read cannot be answered
257
+
258
+ Every read rejects with `QueryClientNotConfiguredError` when the logs sink has no usable ClickHouse
259
+ config, rather than returning an empty result: answer it as a service that is unavailable, not as
260
+ "no logs". The logs, last-log, aggregation and dimensions reads also reject with ClickHouse's error
261
+ when a query fails; the other reads still return an empty result on a failed query.