-
Notifications
You must be signed in to change notification settings - Fork 1
Self-referencing entities related fixes. #605
Copy link
Copy link
Open
Description
fractlrao
opened on Feb 18, 2026
Issue body actions
- Self-referencing relationship queries return wrong results — When both sides of a between relationship point to the same entity (e.g., relationship ReportsTo between(Employee @as manager, Employee @as reportee)), the system can't distinguish which side a given instance belongs to. Querying "who are Alice's reportees?" could return incorrect results because the runtime always treats the connected instance as being on the first side of the relationship.
- Self-referencing one-to-one relationships fail on entity creation — Declaring a one-to-one self-referencing relationship (e.g., relationship Spouse between(Person @as husband, Person @as wife) @one_one) causes entity creation to fail with a NOT NULL constraint error, making one-to-one self-ref unusable.
- Self-referencing one-to-one relationships don't enforce exclusivity — Even after fixing creation, a one-to-one self-referencing relationship silently allows re-pairing without unpairing first. For example, if Alice is married to Bob, marrying Alice to Carol succeeds without error instead of being rejected. The constraint is only enforced after an explicit unpair/divorce step.
- Potential infinite loop with self-referencing relationships — The internal relationship graph walker has no cycle detection, risking infinite recursion when processing self-referencing relationships.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels