Error: Cannot get entity metadata for the given alias
See original GitHub issueIssue 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: Hi. I’m having an issue with retrieving documents from a nested FROM-clause like this:
let query = getConnection().createQueryBuilder()
.from((qb) => {
return qb
.from(A, "a")
.limit(1);
}
, "alias")
And get the error
Cannot get entity metadata for the given alias "alias".
Also, if I try to add another from:
.from(A, "b")
the query works, but the second FROM doesn’t replace the first one, as specified in the docs. How can I do this the right way? Thanks
Issue Analytics
- State:
- Created 4 years ago
- Reactions:73
- Comments:40 (2 by maintainers)
Top Results From Across the Web
TypeORM SQL SubQuery - Stack Overflow
And I'm getting this error : Cannot get entity metadata for the given alias "foo". Cannot figure out why. javascript · sql ·...
Read more >typeorm/typeorm - Gitter
I feel like I'm close but I get the error: TypeORM connection error: Error: Entity metadata for Toy#creator was not found. Check if...
Read more >Entity metadata was not found
EntityMetadataNotFound error is displayed when TypeORM cant find your entities. Often this is caused by wrong/misspelled entry in your ormconfig file. Often ...
Read more >TypeORM - No metadata for "User" was found. - Reddit
For context, I am using typescript (sorry should have posted that). On this, for typeORM in the `ormconfig.json` should the `entities` point to ......
Read more >Select using Query Builder | TypeORM Docs
Most of the time, you need to select real entities from your database, ... In this SQL query, users is the table name,...
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 FreeTop 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
Top GitHub Comments
Works only with getRawMany()
Try this hack:
Hope it will help someone