Commit Graph

388 Commits

Author SHA1 Message Date
10e388421d version: 1.0.162 1.0.162 2026-06-19 15:35:01 -04:00
7f666e0ece Revert "queryer: NULL-tolerant bound for optional single-family forward relations"
This reverts commit 94477b677d.
2026-06-19 15:34:24 -04:00
98a9719509 Revert "queryer: don't emit a parent type-bound for reified-relationship properties"
This reverts commit c97e5d75b3.
2026-06-19 15:34:23 -04:00
0509995589 version: 1.0.161 1.0.161 2026-06-19 11:08:52 -04:00
c97e5d75b3 queryer: don't emit a parent type-bound for reified-relationship properties
A SINGLE reified-relationship property (e.g. invoice.counterparty,
person.primary_contact — a property whose type is a relationship
subtype) is hydrated by a correlated subquery that joins the
relationship table and correlates source_id/target_id = parent.id; its
discriminators (the relationship subtype and the target's type CASE)
are constrained INSIDE that subquery.

For such a property the resolved edge is a REVERSE traversal
(forward = false) over a generic relationship FK
(fk_relationship_source_entity, destination = entity). compile_
polymorphic_bounds then took the `!edge.forward` branch with
poly_col = destination_columns[1] = "type" and
table_to_alias = "entity", which resolves to the PARENT's entity alias
— emitting a bound like `entity_1.type = 'counterparty'` into the
parent WHERE. No parent row has that type, so EVERY parent was dropped
(e.g. get_invoice returned null for an existing invoice whose
counterparty edge was absent).

Array reified traversals (contacts, occupancies) never hit this: an
array property has no bound_type_name. Only the single form did, and it
was previously unexercised.

Fix: in compile_polymorphic_bounds, skip the bound when the property's
resolved type is itself a relationship (type_def.relationship) — there
is no parent-row discriminator column to bound.

Test: new queryer case (person.primary_contact, type=contact) asserts
the parent WHERE has no spurious entity.type bound while the subquery
keeps its discriminator + source_id correlation. Full suite green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 11:03:13 -04:00
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
fb25224d22 version: 1.0.160 1.0.160 2026-06-18 20:31:49 -04:00
01368305de fixed missing schema ids in validation results 2026-06-18 20:31:35 -04:00
9e362f2168 version: 1.0.159 1.0.159 2026-06-15 16:44:04 -04:00
9fffc7707f Merge branch 'main' of gitea-ssh.thoughtpatterns.ai:cellular/jspg 2026-06-15 16:42:13 -04:00
c5d652c6fd fixed merger ordering issue 2026-06-15 16:41:59 -04:00
d2cdd680ed insert fix checkpoint 2026-06-15 16:18:44 -04:00
6f1c0d7ee9 version: 1.0.158 1.0.158 2026-06-12 22:11:14 -04:00
25bbf2b564 merger: generate entity and changelog ids with uuid v7
Switch the two UUID generation sites in the merger from v4 to time-ordered
v7, and swap the uuid crate feature flag from v4 to v7 accordingly.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-12 22:11:09 -04:00
c8cc4cbde8 version: 1.0.157 1.0.157 2026-06-11 20:40:36 -04:00
5af2399e3b fixed issue with filter generation where filters or conditions are used internally 2026-06-11 20:40:27 -04:00
1d56bae9a5 version: 1.0.156 1.0.156 2026-06-11 17:37:43 -04:00
813e9ff3c2 more executor reverts 2026-06-11 17:37:34 -04:00
7e28eb2645 added kind to merge notifications, re-instated sql pattern matching 2026-06-11 17:26:07 -04:00
5133283795 checkpoint for re-enabling SQL pattern matching 2026-06-11 15:25:21 -04:00
d41209e7c1 version: 1.0.155 1.0.155 2026-06-11 12:19:31 -04:00
03c60f5156 fix: remove trigger, origin and redundant type properties from notification payload 2026-06-11 12:19:25 -04:00
1dfd53e53c version: 1.0.154 1.0.154 2026-06-05 19:12:10 -04:00
532bd8da43 fix: remove Spi subtransaction for GUC reads to avoid memory corruption under concurrent load 2026-06-05 19:12:07 -04:00
271828ebe9 version: 1.0.153 1.0.153 2026-06-05 18:56:31 -04:00
8c430d42e3 feat: propagate origin and trigger to cdc and changes 2026-06-05 18:48:46 -04:00
4cc5245336 version: 1.0.152 1.0.152 2026-06-03 10:50:28 -04:00
c71e99527d dynamic type variables now recursive 2026-06-03 10:50:15 -04:00
843891f67e version upped 2026-05-28 14:57:29 -04:00
8bb7085f76 cleaned out raits_debug_val 2026-05-28 14:56:17 -04:00
ea03584bbd re-applied fix for family in conditions 2026-05-28 14:54:57 -04:00
3736c9d8f0 version: 1.0.149 1.0.149 2026-05-21 19:04:00 -04:00
ccca9129b2 added uuid.condition to filters 2026-05-21 19:03:31 -04:00
333fc69735 version: 1.0.148 1.0.148 2026-05-21 13:26:18 -04:00
b0fc6c12ef fixed queryer issue with nested families 2026-05-21 13:26:07 -04:00
0d14162ef4 version: 1.0.147 1.0.147 2026-05-20 19:12:03 -04:00
b755bc6dbd version: 1.0.146 1.0.146 2026-05-20 19:10:39 -04:00
56775c8c1b added traits and include features with docs 2026-05-20 19:10:29 -04:00
a32cb3a4da version: 1.0.145 1.0.145 2026-05-18 19:46:43 -04:00
9cefc225fc fixed type and page action serialization 2026-05-18 19:46:29 -04:00
4874c09fb5 version: 1.0.144 1.0.144 2026-05-14 18:14:10 -04:00
86d49273bc more ordering fixes 2026-05-14 18:13:59 -04:00
724a9e3e44 version: 1.0.143 1.0.143 2026-05-14 17:35:44 -04:00
5b2feb5ea7 more ordering fixes 2026-05-14 17:35:31 -04:00
473b087d97 version: 1.0.142 1.0.142 2026-05-14 14:48:19 -04:00
6d6745d95d removed all jsonb 2026-05-14 14:48:09 -04:00
146efaa2d9 version: 1.0.141 1.0.141 2026-05-14 14:01:41 -04:00
d0294eec3f last ordering fixes 2026-05-14 13:57:50 -04:00
02ab4b6438 version: 1.0.140 1.0.140 2026-05-14 05:58:58 -04:00
2a8b991269 fixed ordering of all things sql 2026-05-14 05:58:38 -04:00