coryodaniel / arbor

Ecto elixir adjacency list and tree traversal. Supports Ecto versions 2 and 3.
MIT License
239 stars 26 forks source link

Recommanded way of retrieving all roots along with their descendents(n)? #34

Closed akashvibhute closed 3 years ago

akashvibhute commented 3 years ago

For a basic Post & Comments schema, I have to retrieve the post along with all of its root comments and the descendents for each root comment upto nth level. From the documentation all the built in functions for descendents work on a struct and not a list of struct/ids, so currently I'm having to retrieve the descendents individually. Is there any easier way of fetching this in single preload query?