Repository navigation
v27.6.1
Fixed
Tier 2 — entity. Tier 3 — realtime.
- An
arrayOf(uuid())column reads on a real Postgres.Bun.SQLhands back the array types it has no parser for as their TEXT literal ('{01a1…,01a2…}'foruuid[], the empty'{}'included), anddecodeRowpassed that string toarrayOf's parser, which refuses anything that is not anArray: every read of a row holding one, thereturningof the insert that wrote it included, wasX_INVARIANT_VIOLATED("column.array: expected an array, got a string of 38 characters", a 422 on the HTTP surface). PGlite parsesuuid[], sox dev, theunitstep and an app's own tests never saw it; only a server did. AnarrayOf()cell is now read by its declaration: anArrayas before, a typed array (Bun.SQLanswersint4[]with anInt32Arrayon a pool that prepares statements) as a plain array, and a string through the Postgres array literal grammar, with quoting, backslash escapes, NULL members and{}, each element then parsed by the element column. A cell that is none of these is stillX_INVARIANT_VIOLATED, now naming the entity and the property; a string in a non-array column is never inspected. Writes, andcontains/overlapswith a bound array, were measured for every element type and were already correct. Nothing to change in an app; rows written before this release read back as written. - Every column kind is round-tripped on both drivers. One entity declares every column kind and an array of every element kind
arrayOf()accepts (nullable elements included), and seven rows go through insert, a keyed read, an unfiltered read and an update on PGlite (unitstep) and onBun.SQLagainst Postgres (livestep), each compared withmemoryDriver(). A kind added toCOLUMN_KINDSwithout a column in that entity fails the suite. The only live array test before this usedarrayOf(text()), the one element type both drivers parse. - The array literal grammar has one reader.
parsePgArraymoved from@ultimat3/realtimeinto@ultimat3/entity(exported from the barrel), and the WAL decoder imports it, so a live row and a repository row cannot disagree about a quoted"NULL".
Commits
- fix(entity): an arrayOf(uuid()) column reads on a real Postgres; every column kind round-trips on both drivers (#752)