You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(shape): centralize cell-key derivation and cover HTTP
Review follow-up. The rule "read row cells via the per-column keys, never
by display name" was enforced only by each consumer re-deriving the keys
itself, and the HTTP paths did not: `shape_http_payload`,
`ddl_results_to_json`, and the NDJSON stream serialize the row map
straight to JSON, so the `_<n>` suffix for duplicate output names was
reaching clients as an undocumented, untested wire contract.
`ShapedRows::cell_keys()` is now the single source of truth. pgwire and
native read through it instead of each calling `project::cell_keys`, the
`rows` field documents that cells are keyed by it, and all three HTTP
sites document the resulting JSON shape: a duplicate-name projection
emits `{"id": …, "id_1": …}` because a JSON object cannot repeat a key
and dropping the duplicate would silently lose a projected column.
pgwire and native stay positional and still report both columns as `id`.
An accessor rather than a stored field: `ShapedRows` has 146 struct
literal construction sites, so a required field would pull that many
unrelated edits into this change. Derivation is per response, not per
row, so caching buys nothing measurable.
Tests: http_result_projection asserts both cells survive over `/v1/query`
AND `/v1/query/stream`.
0 commit comments