-
-
Notifications
You must be signed in to change notification settings - Fork 502
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
Query builder, nested partial select does not work #4364
Comments
This is indeed not supported, only relations that are joined via the But it should work with the |
@B4nan it does not:
reuslts in:
|
That is not how you do partial loading with |
@B4nan thanks, sorry my mistake. |
I think it should be rather easy to implement it the QB support way: const qb = em.createQueryBuilder(AuditLogParams, "a");
const result = await qb
// .select(["a.*"]) // this is not really necessary, root entity is selected automatically
.leftJoinAndSelect("a.user", "u", {}, ["email"])
.leftJoinAndSelect("a.ticketAuditLog", "al"); The problem with mapping the things you select explicitly is that they might be aliased, or can be even raw fragments, so it would be harder to detect what you were up to - moreover, the approach with |
@B4nan |
I'm running the following query and I want only to select the email of the user (memory wise)
raw sql:
this is the result I get:
as you can see the email field in the user is missing
if I'm using 'leftJoinAndSelect' it does map the user fields but than I cant select only the email:
raw sql:
results in:
The text was updated successfully, but these errors were encountered: