Not able to search in relations of relations (Nested Relations throw missing FROM-clause entry)
See original GitHub issueI wanted to implement a search using a property from a relation of a relation from my Entity.
json searchableColumns: [ "title", "games.genres.name" ],
But i get this:
error: ┏ missing FROM-clause entry for table "genres"
error: ┃ [ 1] QueryFailedError: missing FROM-clause entry for table "genres"
error: ┃ [ 2] at PostgresQueryRunner.query (/app/node_modules/.pnpm/typeorm@0.3.10_pg@8.8.0+ts-node@10.9.1/node_modules/typeorm/driver/postgres/PostgresQueryRunner.js:211:19)
error: ┃ [ 3] at runMicrotasks (<anonymous>)
error: ┃ [ 4] at processTicksAndRejections (node:internal/process/task_queues:96:5)
error: ┃ [ 5] at async SelectQueryBuilder.loadRawResults (/app/node_modules/.pnpm/typeorm@0.3.10_pg@8.8.0+ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:2056:25)
error: ┃ [ 6] at async SelectQueryBuilder.getRawMany (/app/node_modules/.pnpm/typeorm@0.3.10_pg@8.8.0+ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:607:29)
error: ┃ [ 7] at async SelectQueryBuilder.executeEntitiesAndRawResults (/app/node_modules/.pnpm/typeorm@0.3.10_pg@8.8.0+ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:1860:26)
error: ┃ [ 8] at async SelectQueryBuilder.getManyAndCount (/app/node_modules/.pnpm/typeorm@0.3.10_pg@8.8.0+ts-node@10.9.1/node_modules/typeorm/query-builder/SelectQueryBuilder.js:771:36)
error: ┃ [ 9] at async paginate (/app/node_modules/.pnpm/nestjs-paginate@4.5.1_5lrjep46ocnlg5z2ezquymw4bm/node_modules/nestjs-paginate/lib/paginate.js:283:27)
error: ┃ [10] at async TagsController.get (/app/dist/controllers/tags.controller.js:32:34)
error: ┃ [11] at async /app/node_modules/.pnpm/@nestjs+core@9.2.0_jfowmhmgk7kwjudosrpv7e7liy/node_modules/@nestjs/core/router/router-execution-context.js:46:28
error: ┗ [12] { context: 'ExceptionsHandler' }
Aren’t nested relations supported in the search?
Issue Analytics
- State:
- Created 9 months ago
- Reactions:1
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Postgres: missing FROM-clause entry for table - Stack Overflow
In your first join 'payments_action' is not a known relation. Reorder your joins in a way that a new join only uses already...
Read more >missing FROM-clause entry for table "???????" #3000 - GitHub
I ma facing same issue, when trying to save entity with many2many relationship. This is the query its generating: SELECT ...
Read more >Fix “ERROR: missing FROM-clause entry for table” in ...
Another way to fix it is to use an alias for the column: (SELECT TeacherName t FROM Teachers) UNION (SELECT StudentName FROM Students)...
Read more >Datomic Queries and Rules
Queries and rules output relations with tuples of varying arity, and Datomic's query engine can accept as inputs relation-like data in arbitrary collections....
Read more >Database Engine events and errors - SQL Server
Consult this MSSQL error code list to find explanations for error messages for SQL Server database engine events.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

+1
I also have the same question
@ppetzold Can you please let me know if relations can accept ManyToOne ? because I want to populate this relation in my response search inside it as well