New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Define Tree Depth #3909
Comments
I am also interested in this. Right now the closure table strategy does not store the tree depth in the table, so without code changes to how the strategy is implemented this probably isn't possible. |
Any workaround for this? |
tiagojsag
added a commit
to tiagojsag/typeorm
that referenced
this issue
Jul 17, 2021
…using TreeRepository's findTrees() and findDescendantsTree() Modified TreeRepository's findTrees() and findDescendantsTree() public methods to now accept an optional object with config options. For now, said object contains a depth parameter that, if set, will limit how far down the tree those methods will crawl and retrieve nested entities. BREAKING CHANGE: TreeRepository's protected method buildChildrenEntityTree() now requires a 4th argument. Anyone affected by this break should also review and update their implementation, otherwise this feature will not work. Closes: typeorm#3909
7 tasks
tiagojsag
added a commit
to tiagojsag/typeorm
that referenced
this issue
Jul 17, 2021
…using TreeRepository's findTrees() and findDescendantsTree() Modified TreeRepository's findTrees() and findDescendantsTree() public methods to now accept an optional object with config options. For now, said object contains a depth parameter that, if set, will limit how far down the tree those methods will crawl and retrieve nested entities. BREAKING CHANGE: TreeRepository's protected method buildChildrenEntityTree() now requires a 4th argument. Anyone affected by this break should also review and update their implementation, otherwise this feature will not work. Closes: typeorm#3909
tiagojsag
added a commit
to tiagojsag/typeorm
that referenced
this issue
Jul 17, 2021
…using TreeRepository's findTrees() and findDescendantsTree() Modified TreeRepository's findTrees() and findDescendantsTree() public methods to now accept an optional object with config options. For now, said object contains a depth parameter that, if set, will limit how far down the tree those methods will crawl and retrieve nested entities. BREAKING CHANGE: TreeRepository's protected method buildChildrenEntityTree() now requires a 4th argument. Anyone affected by this break should also review and update their implementation, otherwise this feature will not work. Closes: typeorm#3909
tiagojsag
added a commit
to tiagojsag/typeorm
that referenced
this issue
Aug 24, 2021
…using TreeRepository's findTrees() and findDescendantsTree() Modified TreeRepository's findTrees() and findDescendantsTree() public methods to now accept an optional object with config options. For now, said object contains a depth parameter that, if set, will limit how far down the tree those methods will crawl and retrieve nested entities. BREAKING CHANGE: TreeRepository's protected method buildChildrenEntityTree() now requires a 4th argument. Anyone affected by this break should also review and update their implementation, otherwise this feature will not work. Closes: typeorm#3909
tiagojsag
added a commit
to tiagojsag/typeorm
that referenced
this issue
Nov 3, 2021
…using TreeRepository's findTrees() and findDescendantsTree() Modified TreeRepository's findTrees() and findDescendantsTree() public methods to now accept an optional object with config options. For now, said object contains a depth parameter that, if set, will limit how far down the tree those methods will crawl and retrieve nested entities. BREAKING CHANGE: TreeRepository's protected method buildChildrenEntityTree() now requires a 4th argument. Anyone affected by this break should also review and update their implementation, otherwise this feature will not work. Closes: typeorm#3909
tiagojsag
added a commit
to tiagojsag/typeorm
that referenced
this issue
Nov 11, 2021
…using TreeRepository's findTrees() and findDescendantsTree() Modified TreeRepository's findTrees() and findDescendantsTree() public methods to now accept an optional object with config options. For now, said object contains a depth parameter that, if set, will limit how far down the tree those methods will crawl and retrieve nested entities. BREAKING CHANGE: TreeRepository's protected method buildChildrenEntityTree() now requires a 4th argument. Anyone affected by this break should also review and update their implementation, otherwise this feature will not work. Closes: typeorm#3909
pleerock
pushed a commit
that referenced
this issue
Nov 11, 2021
…using TreeRepository's findTrees() and findDescendantsTree() (#7926) Modified TreeRepository's findTrees() and findDescendantsTree() public methods to now accept an optional object with config options. For now, said object contains a depth parameter that, if set, will limit how far down the tree those methods will crawl and retrieve nested entities. BREAKING CHANGE: TreeRepository's protected method buildChildrenEntityTree() now requires a 4th argument. Anyone affected by this break should also review and update their implementation, otherwise this feature will not work. Closes: #3909
HeartPattern
pushed a commit
to HeartPattern/typeorm
that referenced
this issue
Nov 29, 2021
…using TreeRepository's findTrees() and findDescendantsTree() (typeorm#7926) Modified TreeRepository's findTrees() and findDescendantsTree() public methods to now accept an optional object with config options. For now, said object contains a depth parameter that, if set, will limit how far down the tree those methods will crawl and retrieve nested entities. BREAKING CHANGE: TreeRepository's protected method buildChildrenEntityTree() now requires a 4th argument. Anyone affected by this break should also review and update their implementation, otherwise this feature will not work. Closes: typeorm#3909
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Issue type:
[x] question
[ ] bug report
[ ] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ ]
oracle
[x]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
Linking to the official documentation about Trees.
Is it possible to limit the depth in a recursive tree hierarchy?
For example something like that:
and then the response would look like this:
This could be helpful to "paginate" trees and to improve the performance of APIs.
The text was updated successfully, but these errors were encountered: