Commit 54c2627
docs: correct temporal-field storage and filter semantics in the ObjectQL reference (#4051)
* fix(driver-sql): Field.date NOW() default reads the UTC calendar day on PG/MySQL (#4022); raise cloud-connection seed-lookup test timeout
Two follow-ups from the #3994 line:
1. Field.date + defaultValue NOW() emitted a bare CURRENT_TIMESTAMP default,
which resolves the calendar day in the SERVER's timezone on Postgres —
measured: a UTC-12 server recorded yesterday's date; an Asia/Shanghai
server records tomorrow for every default after 16:00 UTC. MySQL 8.0
additionally rejects the bare default on a DATE column outright (MariaDB
is merely permissive, and the driver's UTC-pinned session masked the
semantic half there). nowColumnDefault now emits a UTC expression default
on both dialects — timezone('utc', now())::date on Postgres,
(cast(utc_timestamp() as date)) on MySQL — the #3994 D-C3 construction
one type over. Defaults only govern newly created columns (D-B3 policy).
Live tests pin the expression and a defaulted-insert round-trip.
2. marketplace-install-local-seed-lookup.test.ts: 30s → 120s timeout. The
test cold-imports the real @objectstack/runtime on purpose; under a fully
parallel turbo run that import stalls on core contention and the 30s cap
produced recurring false reds (observed 3x, passes standalone). A genuine
hang still fails, just later.
Closes #4022
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TPxNwPnjcn599ujXpU3ibJ
* docs: correct temporal-field storage and filter semantics in the ObjectQL reference
The temporal line (#3912 #3928 #3942 #3954 #3979 #3994 #4022) changed what a
Field.date / Field.datetime / Field.time physically IS, and three hand-written
docs still described the pre-#3912 world. Audited against the implementation
(sql-driver.ts canonicalUtcDatetime / canonicalTimeOfDay / toDateOnly /
nowColumnDefault / createColumn) and ADR-0053 addenda D-B1..D-B4, D-C1..D-C3,
with an adversarial verification pass.
- protocol/objectql/types.mdx: per-type storage form and physical column type
per dialect — canonical UTC ISO TEXT on SQLite, timestamptz on Postgres,
DATETIME(3) on MySQL (with why NOT TIMESTAMP: 2038 ceiling, dropped
milliseconds, session-tz conversion); time as HH:MM:SS gaining .fff only
when the milliseconds are non-zero; the MySQL literal respelling; and a new
defaultValue: 'NOW()' section stating the UTC-clock rule.
- protocol/objectql/query-syntax.mdx: the comparand table (a filter value is
canonicalised by the same function as a write, so both sides of a comparison
share one shape on every dialect) and the date-vs-datetime range trap — a
$between of bare dates against a datetime column stops at midnight.
- data-modeling/queries.mdx: the same comparand rules at the query-authoring
altitude, plus UTC bucket boundaries for date bucketing.
Scope note: nine further docs were audited in the same pass but their agents
ran against a stale base commit that predated this work, so their output
described superseded behaviour and is deliberately NOT included. Their
pristine text carries no incorrect temporal claim — only looser wording — so
nothing is left wrong by omitting them.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TPxNwPnjcn599ujXpU3ibJ
* chore: trigger CI
The docs commit landed on the branch without GitHub Actions firing (0
workflow runs for that SHA; only the Vercel status attached). Neither a
close/reopen re-triggered it, so this empty commit forces a synchronize
event to get real CI signal before merge.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TPxNwPnjcn599ujXpU3ibJ
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 12a19a8 commit 54c2627
4 files changed
Lines changed: 594 additions & 204 deletions
File tree
- .changeset
- content/docs
- data-modeling
- protocol/objectql
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
64 | 65 | | |
65 | 66 | | |
66 | 67 | | |
| |||
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
76 | 112 | | |
77 | 113 | | |
78 | 114 | | |
| |||
167 | 203 | | |
168 | 204 | | |
169 | 205 | | |
170 | | - | |
| 206 | + | |
171 | 207 | | |
172 | 208 | | |
173 | 209 | | |
| |||
176 | 212 | | |
177 | 213 | | |
178 | 214 | | |
179 | | - | |
180 | | - | |
181 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
182 | 222 | | |
183 | 223 | | |
184 | 224 | | |
| |||
211 | 251 | | |
212 | 252 | | |
213 | 253 | | |
214 | | - | |
215 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
216 | 265 | | |
217 | 266 | | |
218 | 267 | | |
219 | 268 | | |
220 | 269 | | |
221 | 270 | | |
222 | | - | |
223 | | - | |
224 | | - | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
225 | 275 | | |
226 | 276 | | |
227 | 277 | | |
| |||
239 | 289 | | |
240 | 290 | | |
241 | 291 | | |
242 | | - | |
243 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
244 | 298 | | |
245 | 299 | | |
246 | 300 | | |
| |||
481 | 535 | | |
482 | 536 | | |
483 | 537 | | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
484 | 570 | | |
485 | 571 | | |
486 | 572 | | |
| |||
530 | 616 | | |
531 | 617 | | |
532 | 618 | | |
533 | | - | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
534 | 623 | | |
535 | | - | |
| 624 | + | |
536 | 625 | | |
537 | 626 | | |
538 | 627 | | |
| |||
0 commit comments