Problem
Let's say I have a table called categories. This table can refer to itself as a foreign key with parentCategory.
So a categories can have many subcategories, and subcategories can also have subcategories, with an unlimited combination. The idea is to support recursive queries to easily query them along with their sub categories.
Suggested solution
Some valid implementation of something similar to Postgres WITH RECURSIVE
https://www.postgresqltutorial.com/postgresql-recursive-query/
Alternatives
N/A
Additional context
N/A
Problem
Let's say I have a table called
categories. This table can refer to itself as a foreign key withparentCategory.So a categories can have many subcategories, and subcategories can also have subcategories, with an unlimited combination. The idea is to support recursive queries to easily query them along with their sub categories.
Suggested solution
Some valid implementation of something similar to Postgres
WITH RECURSIVEhttps://www.postgresqltutorial.com/postgresql-recursive-query/
Alternatives
N/A
Additional context
N/A