Skip to content

Commit 5123c56

Browse files
os-zhuangclaude
andcommitted
chore(changeset): driver-sql type-fidelity patch
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent f6af800 commit 5123c56

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

.changeset/field-type-fidelity.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
"@objectstack/driver-sql": patch
3+
---
4+
5+
fix(driver-sql): round-trip rating/slider/toggle/progress with type fidelity
6+
7+
`rating`/`slider`/`toggle`/`progress` had no case in the DDL column-type switch, so they fell to `default → table.string` (TEXT affinity). SQLite then coerced the written value to a string — `rating: 4` read back `'4'`, `toggle: true` read back `'1'` — so the value persisted but the JS type leaked on read. On a low-code platform where field types are author-driven, a field that silently returns the wrong type is a runtime-fidelity trap the static gates and value-loss tests don't catch.
8+
9+
- `rating`/`slider`/`progress` now map to a REAL (numeric) column.
10+
- `toggle` maps to a boolean column and is registered in the boolean read-coercion path, so stored `1`/`0` come back as real JS booleans.
11+
- The object-valued `record`/`video`/`audio` types are folded into the shared `JSON_COLUMN_TYPES` source, and the DDL `default` case now derives JSON-vs-string from that set, so the column-type switch and `isJsonField` (the read-side deserializer) can no longer drift.

0 commit comments

Comments
 (0)