WrenAI icon indicating copy to clipboard operation
WrenAI copied to clipboard

Support for self-referencing relationships (recursive joins) in ERD

Open xpfxzxc opened this issue 6 months ago • 0 comments

Currently, the ERD modeling interface in WrenAI does not seem to support creating a relationship from a table to itself (a self-referencing or recursive relationship). This limitation makes it difficult to accurately model and guide the AI on how to handle hierarchical data structures, which are very common in ERP and business intelligence systems.

For example, I have a T_BD_MATERIALGROUP (Material Groups) table with a hierarchical structure, where FPARENTID (parent ID) references FID (primary key) within the same table to define parent-child relationships. Without the ability to define this self-join in the ERD, WrenAI has difficulty understanding how to query multi-level hierarchies, such as retrieving a full category path (e.g., "Level 1 > Level 2 > Level 3").

xpfxzxc avatar Jul 03 '25 08:07 xpfxzxc