Files
jspg/fixtures
Satya 94477b677d queryer: NULL-tolerant bound for optional single-family forward relations
An OPTIONAL forward polymorphic relation declared via `family` (e.g.
order.counterparty / invoice.counterparty) had its auto-generated type
bound `{alias}.{disc} IN (variations)` emitted into the PARENT row's
WHERE. When the relation is absent (NULL discriminator) the parent row
was wrongly excluded — a counterparty-less order/invoice returned
nothing instead of the row with `counterparty: null`.

Fix: in `compile_polymorphic_bounds`, make the forward-FK bound
NULL-tolerant (`(… IN (…) OR …_type IS NULL)`), gated on
`!r#type.relationship`:
  - real entities get NULL-tolerance (the relation is an optional
    attribute; an absent one must not drop the row — the inner CASE
    already resolves it to NULL);
  - edge entities (`relationship == true`, e.g. `contact`) keep the
    bound EXACT, because there source_type/target_type *partition*
    typed sub-collections (phone_numbers vs email_addresses) and a NULL
    endpoint belongs to no partition.

Note: the `oneOf` path was already correct — it emits no parent bound
(resolves via CASE … ELSE NULL), so cross-family optional relations
already hydrate NULL-safely. Added a fixture case documenting that.

Tests (fixtures/queryer.json): case 15 (entity → NULL-tolerant),
cases 3/5/10 (contact edges → exact, unchanged), new case 16
(oneOf cross-family → no bound). Full suite green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 10:22:29 -04:00
..
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-06-15 16:41:59 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-06-15 16:41:59 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-06-15 16:41:59 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00
2026-04-17 18:25:14 -04:00