person { id}person_to_person { id parent_id child_id}
person { id}person_to_person { id parent_id child_id}
The parent_id and child_id are references to the person table. I am trying to create a family tree-like structure, which means that I need to fetch every child recursively until there are no children left to fetch.
Imagine a family tree. If you know the id of any given member in that tree (could be anywhere in the family tree), fetch all of its children recursively all the way to the bottom where there are no more children left.
How do I accomplish this with Drizzle ORM? Preferably I want the result to be typed, so that the front-end can easily show this family tree on a webpage.