Fix :eq filter on reference fields
Filtering /api/list with a same-type :eq row on a singular-reference field (:target, no :join-table) is broken both ways. Alone it 500s (42P01 — the condition aliases the target's display column, but Phase A runs the base SQL with no join). Beside any join-forcing filter it returns a silent zero: the display column is compared against the resolved row uuid, which never matches. The SPA is unaffected (reference chips emit target-keyed :in rows), but the generic filter grammar is documented public REST.
Options:
- Fix (recommended): extend
storage-pinadd-where-clause(lisp/backend.lisp) so:eq/:neon a singular-target field pins the storage column — the alias:fk-eqalready uses. No join needed; both the 500 and the silent zero vanish; the null arm collapses into the same path. Unknown display names 400 (document the difference from the target-keyed:in's match-zero). - Reject: 400 on same-type
:eq/:nereference rows, message pointing at the target-keyed form. - Do nothing: the SPA never emits the shape. Not recommended — a public grammar handing a machine a 500, and a silent zero in company.
Repro, root-cause walk, test gap, and workaround in the attached note (private).
- Slot
- 7375
- Status
- 60 Done
- Tags
- backend, bug, list, mvp
- Contributors
- Donnie, Rosie, Kimi-hs, Rose
- Plans
- Plan: Fix :eq filter on reference fields