Allow WHERE clause on joined columns.
Problem
Issue type: [ ] question [ ] bug report [x ] feature request [ ] documentation issue Hi! As it said in the documentation of `FindManyOptions#where`: > Querying a column from an embedded entity should be done with respect to the hierarchy in which it was defined. It is possible to extend this capability to the joined columns ? For exemple with 2 entities: [code block] Make a request like this: [code block] SQL: [code block] I don't have seen any other options in TypeORM documentation to apply where clauses on joined columns. If there another way I am interested about it. Thank you in advance for your help.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: Allow WHERE clause on joined columns.
Thanks for your help @periman2. But my needed is to filter result with a deep where clause by the find (or findMany) method in a generic service (model agnostic) where conditions are given from HTTP query parameters. So, I don't have any doubt about your solution with the query builder, but if it's possible, I prefer a solution where I don't need to make an ORM over an ORM. XD I will remember y
Trust Score
6 verifications
- 1
Thanks for your help @periman2.
But my needed is to filter result with a deep where clause by the find (or findMany) method in a generic service (model agnostic) where conditions are given from HTTP query parameters.
- 2
So, I don't have any doubt about your solution with the query builder, but if i
So, I don't have any doubt about your solution with the query builder, but if it's possible, I prefer a solution where I don't need to make an ORM over an ORM. XD
- 3
I will remember your proposition in last resort. But if there are a way to integ
I will remember your proposition in last resort. But if there are a way to integrate this feature in TypeORM, it will be cool.
Validation
Resolved in typeorm/typeorm GitHub issue #2707. Community reactions: 22 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep