Commit bc22a89
fix(driver-sql): present Field.time as a wall-clock time-of-day on read (SQLite) (#2347)
Field.time is a tz-naive time-of-day, not an instant (#2004). A
defaultValue:'NOW()' time column historically took the full SQLite
CURRENT_TIMESTAMP default, so a defaulted/legacy row read back a full
'YYYY-MM-DD HH:MM:SS' timestamp instead of a time-of-day.
formatOutput now repairs a Field.time value to just its time portion (toTimeOnly):
a legacy full timestamp (or a full ISO value that leaked into the column) is
sliced to HH:MM[:SS[.fff]], while a value already stored as a bare time-of-day is
left untouched. Deliberately NARROW + read-only (no write/filter counterpart) so
it introduces no write/read asymmetry and preserves exact round-trips for bare
time-of-day values (the field-zoo f_time guard). Runs for every dialect (a native
TIME column already returns a time-of-day → no-op). Adds a timeFields registry +
registration mirroring dateFields/datetimeFields.
Completes the temporal read normalization alongside #2346: datetime -> ISO-8601-Z,
date -> YYYY-MM-DD, time -> wall-clock time-of-day.
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>1 parent 8a7e9f1 commit bc22a89
3 files changed
Lines changed: 167 additions & 0 deletions
File tree
- .changeset
- packages/plugins/driver-sql/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
Lines changed: 91 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
321 | 321 | | |
322 | 322 | | |
323 | 323 | | |
| 324 | + | |
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
| |||
1546 | 1547 | | |
1547 | 1548 | | |
1548 | 1549 | | |
| 1550 | + | |
1549 | 1551 | | |
1550 | 1552 | | |
1551 | 1553 | | |
| |||
1557 | 1559 | | |
1558 | 1560 | | |
1559 | 1561 | | |
| 1562 | + | |
1560 | 1563 | | |
1561 | 1564 | | |
1562 | 1565 | | |
| |||
1573 | 1576 | | |
1574 | 1577 | | |
1575 | 1578 | | |
| 1579 | + | |
1576 | 1580 | | |
1577 | 1581 | | |
1578 | 1582 | | |
| |||
1622 | 1626 | | |
1623 | 1627 | | |
1624 | 1628 | | |
| 1629 | + | |
| 1630 | + | |
| 1631 | + | |
1625 | 1632 | | |
1626 | 1633 | | |
1627 | 1634 | | |
| |||
2366 | 2373 | | |
2367 | 2374 | | |
2368 | 2375 | | |
| 2376 | + | |
| 2377 | + | |
| 2378 | + | |
| 2379 | + | |
| 2380 | + | |
| 2381 | + | |
| 2382 | + | |
| 2383 | + | |
| 2384 | + | |
| 2385 | + | |
| 2386 | + | |
| 2387 | + | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
| 2392 | + | |
| 2393 | + | |
| 2394 | + | |
| 2395 | + | |
| 2396 | + | |
| 2397 | + | |
| 2398 | + | |
| 2399 | + | |
| 2400 | + | |
| 2401 | + | |
| 2402 | + | |
| 2403 | + | |
| 2404 | + | |
2369 | 2405 | | |
2370 | 2406 | | |
2371 | 2407 | | |
| |||
3096 | 3132 | | |
3097 | 3133 | | |
3098 | 3134 | | |
| 3135 | + | |
| 3136 | + | |
| 3137 | + | |
| 3138 | + | |
| 3139 | + | |
| 3140 | + | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
| 3147 | + | |
| 3148 | + | |
| 3149 | + | |
| 3150 | + | |
| 3151 | + | |
3099 | 3152 | | |
3100 | 3153 | | |
3101 | 3154 | | |
| |||
0 commit comments