Skip to content

Commit e381bcd

Browse files
committed
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01CB6W87z22K2yjUCDyVrJRk
1 parent 55e6f14 commit e381bcd

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎skills/objectstack-query/rules/aggregation.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ aggregations (never bucket by hand in app code):
7979
the projected COLUMN only** — grouping still keys on the field, so the buckets
8080
themselves are unchanged. Read the result under `alias ?? field`, and reference
8181
that same name from `having`.
82-
- The engine pushes bucketing down to the driver (`DATE_TRUNC` etc.) when
83-
the dialect supports that granularity, and transparently falls back to
84-
in-memory bucketing otherwise — results are correct either way, **including
85-
the column keys**.
82+
- The engine pushes bucketing down to the driver (`to_char` / `date_format` /
83+
`strftime` / `$dateToString`, never `date_trunc`) when the dialect supports
84+
that granularity, and transparently falls back to in-memory bucketing
85+
otherwise — results are correct either way, **including the column keys**.
8686

8787
## HAVING Clause
8888

‎skills/objectstack-ui/rules/dashboards.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,14 +318,14 @@ const signedByMonth: DashboardWidget = { id: 'signed_by_month', type: 'line',
318318
| `dateGranularity` | Rendered bucket label |
319319
|:--|:--|
320320
| `'day'` | `YYYY-MM-DD` |
321-
| `'week'` | ISO date of the bucket (`YYYY-MM-DD`) |
321+
| `'week'` | ISO week `YYYY-Www` |
322322
| `'month'` | `YYYY-MM` |
323323
| `'quarter'` | `YYYY-Qn` |
324324
| `'year'` | `YYYY` |
325325

326-
* **Engine support** — Postgres `date_trunc`, MySQL `date_format`, SQLite
327-
`strftime`, MongoDB `$dateTrunc`, in-memory fallback. All emitted by the
328-
analytics service, not the client.
326+
* **Engine support** — drivers emit the bucket as a label (`2026-01`), not
327+
an instant: Postgres `to_char`, MySQL `date_format`, SQLite `strftime`,
328+
MongoDB `$dateToString`, in-memory `bucketDateKey`.
329329
* **Human labels are automatic** — the analytics layer formats the bucket value
330330
to the label above, and resolves `select`/`lookup` dimension values to their
331331
option label / related-record name. Measures carry their `label` + `format`

0 commit comments

Comments
 (0)