Skip to content
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

Adjacency list tree questions #5678

Closed
fullofcaffeine opened this issue Mar 13, 2020 · 3 comments
Closed

Adjacency list tree questions #5678

fullofcaffeine opened this issue Mar 13, 2020 · 3 comments

Comments

@fullofcaffeine
Copy link

fullofcaffeine commented Mar 13, 2020

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)

Hi!

I'm implementing an adjacency list tree and I have some questions:

  1. From what I saw, the helper methods exposed by the TreeRepository are not avaible for adjacency list trees, right? If so, why?
  2. Since I'm using PostgreSQL, I'd like to use a WITH [RECURSIVE] query (as described here) to query my recursive entities. How could I do that with TypeORM? From what I see, the QueryBuilder does not support it, and if I use raw queries, it doesn't return the entities, but raw data.
  3. And not entirely related to the problem, but curious: Can the TreeRepository be used with AR-like entities?

Thanks!

@fullofcaffeine
Copy link
Author

fullofcaffeine commented Mar 16, 2020

Alright, found the answers for question 1 and 3, here: #2540.

I'd still like to know if there's an actual official way of querying WITH [...] without having to use a raw query, any hints?

@tafelito
Copy link

@fullofcaffeine have you ever find a way to do a recursive view like you mentioned in 2?

@imnotjames
Copy link
Contributor

For questions, please check out the community slack or check TypeORM's documentation page on other support avenues - cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants