Recursive CTE
Hello all, I'm trying to make a recursive query, but I'm not sure where to start?
I have something like the following model:
And am looking to make a query that flattens this hierachy like the following example found on postgres' official docs:
My current two ideas is to use either raw SQL queries or make views, any thoughts?
Solution:Jump to solution
I'm not sure I'm too satisfied with the answer, but I ended up writing a view to solve my issue, and then use seed.ts to ensure that it exists.
1 Reply
Solution
I'm not sure I'm too satisfied with the answer, but I ended up writing a view to solve my issue, and then use seed.ts to ensure that it exists.