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
{{ message }}
Repository navigation
Commit efc2c91
Browse filesBrowse the repository at this point in the historyBrowse files
fix(codegen-ts): a read-only projection keyed on a non-id field addresses its own key (FR-044)
The read-only mounts address a row by `idColumn`, which defaults to `id`. The
routes templates never passed it, so a projection whose identity is on another
field (say `code`) mounted `GET /:id` against a column the view does not have.
The mount then ran the query with no WHERE and answered with the view's first
row.
Generators: the Fastify and Hono routes templates, and their reference copies,
emit `idColumn: "<field>"` in the read-only mount options when the by-id field
is not `id`. It is the field `find<Name>ById` reads, through a new
`itemRouteField` (`hasItemRoute` is now "it is defined"). A projection keyed on
`id` keeps its bytes; no golden moved.
Runtime: both read-only mounts answer `404 not_found` when the view declares
columns and has none under `idColumn`, instead of an unfiltered row. That also
makes an owned routes generator that predates the option fail safe.
Owned copies under test-generators and examples are re-synced.
0 commit comments