From e381bcd9e137fc6dac9987b72b8527ac02f0da76 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 4 Oct 2026 02:29:32 +0000 Subject: [PATCH] docs(skills): date-bucket engine sentences name what each arm emits The dashboards rule said Postgres buckets with date_trunc and MongoDB with $dateTrunc; the drivers emit a label (to_char / date_format / strftime / $dateToString, in memory bucketDateKey), never an instant. The 'week' row now reads the ISO week label YYYY-Www every arm answers, and the aggregation rule's push-down sentence names the same expression family instead of DATE_TRUNC. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01CB6W87z22K2yjUCDyVrJRk --- skills/objectstack-query/rules/aggregation.md | 8 ++++---- skills/objectstack-ui/rules/dashboards.md | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/skills/objectstack-query/rules/aggregation.md b/skills/objectstack-query/rules/aggregation.md index 745a49cb4c0..0b5b20581b0 100644 --- a/skills/objectstack-query/rules/aggregation.md +++ b/skills/objectstack-query/rules/aggregation.md @@ -79,10 +79,10 @@ aggregations (never bucket by hand in app code): the projected COLUMN only** — grouping still keys on the field, so the buckets themselves are unchanged. Read the result under `alias ?? field`, and reference that same name from `having`. -- The engine pushes bucketing down to the driver (`DATE_TRUNC` etc.) when - the dialect supports that granularity, and transparently falls back to - in-memory bucketing otherwise — results are correct either way, **including - the column keys**. +- The engine pushes bucketing down to the driver (`to_char` / `date_format` / + `strftime` / `$dateToString`, never `date_trunc`) when the dialect supports + that granularity, and transparently falls back to in-memory bucketing + otherwise — results are correct either way, **including the column keys**. ## HAVING Clause diff --git a/skills/objectstack-ui/rules/dashboards.md b/skills/objectstack-ui/rules/dashboards.md index 69c22ded67a..990102821b2 100644 --- a/skills/objectstack-ui/rules/dashboards.md +++ b/skills/objectstack-ui/rules/dashboards.md @@ -318,14 +318,14 @@ const signedByMonth: DashboardWidget = { id: 'signed_by_month', type: 'line', | `dateGranularity` | Rendered bucket label | |:--|:--| | `'day'` | `YYYY-MM-DD` | -| `'week'` | ISO date of the bucket (`YYYY-MM-DD`) | +| `'week'` | ISO week `YYYY-Www` | | `'month'` | `YYYY-MM` | | `'quarter'` | `YYYY-Qn` | | `'year'` | `YYYY` | -* **Engine support** — Postgres `date_trunc`, MySQL `date_format`, SQLite - `strftime`, MongoDB `$dateTrunc`, in-memory fallback. All emitted by the - analytics service, not the client. +* **Engine support** — drivers emit the bucket as a label (`2026-01`), not + an instant: Postgres `to_char`, MySQL `date_format`, SQLite `strftime`, + MongoDB `$dateToString`, in-memory `bucketDateKey`. * **Human labels are automatic** — the analytics layer formats the bucket value to the label above, and resolves `select`/`lookup` dimension values to their option label / related-record name. Measures carry their `label` + `format`