Commit f0ac3e4
Both samples on `content/docs/protocol/objectql/schema.mdx` taught a shape that
today produces a rejected write or a bogus physical column DEFAULT. Measured on
`origin/main` before and after:
* `due_datetime` carried a BARE CEL source string. `applyFieldDefaults`
recognises an expression only by `{ dialect, source }`, so the bare string
fell to the literal branch; an insert was refused
("bad_dt must be a valid datetime (ISO-8601)"), and the SQL DDL emitted
`` `cur_due_datetime` datetime default 'daysFromNow(7)' `` -- the source
text as a physical column DEFAULT. Replaced with the explicit envelope,
which evaluates (2026-08-17T00:00:00.000Z from a 2026-08-10 now) and emits
no column DEFAULT.
* `revenue` carried `{ value: 0, currency: 'USD' }`. `currency` is in
`NUMERIC_VALUE_TYPES`, so the stored contract is `z.number().finite()`;
the object was refused by the record validator and dropped entirely by the
SQL DDL (no default at all). Replaced with `0`, which stores and emits
`float default '0'`.
The inline comments now state what the corrected samples actually mean,
including that `defaultValue` -- unlike a formula field's `expression` -- has
no bare-string CEL shorthand, which is the trap the old sample set.
Docs-only: no behaviour change, no changeset.
Claude-Session: https://claude.ai/code/session_01KJATVrh6V2ysutYUJigh3B
Co-authored-by: Claude <noreply@anthropic.com>
1 parent 4d94308 commit f0ac3e4
1 file changed
Lines changed: 5 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
382 | 382 | | |
383 | 383 | | |
384 | 384 | | |
385 | | - | |
| 385 | + | |
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| |||
396 | 396 | | |
397 | 397 | | |
398 | 398 | | |
399 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
400 | 403 | | |
401 | 404 | | |
402 | 405 | | |
| |||
0 commit comments