You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading a 1:1 relation from a model, and also loading it's related model, an error is thrown: cannot apply alias for expr other than Column or AsEnum
let line_item:line_item:Model = line_item::Entity::find().one(&ctx.db).await?;let(order, customer):(order::Model,Option<customer::Model>) = line_item.find_related(order::Entity).find_also_related(customer::Entity).one(&ctx.db).await?;
My assumption is that this fails as it's finding the related customer for the line_item (not the order!) and that line_item and customer are not related.
Expected Behavior
The expected behaviour is that this would work, and that the order is loaded, and the customer the order is linked to.
Actual Behavior
An error is thrown: cannot apply alias for expr other than Column or AsEnum
Versions
Tested on 1.1.0
The text was updated successfully, but these errors were encountered:
georgeboot
changed the title
Can not combine
Can not combine find_related and find_also_related
Jan 13, 2025
Description
When loading a 1:1 relation from a model, and also loading it's related model, an error is thrown:
cannot apply alias for expr other than Column or AsEnum
My assumption is that this fails as it's finding the related customer for the line_item (not the order!) and that line_item and customer are not related.
Expected Behavior
The expected behaviour is that this would work, and that the order is loaded, and the customer the order is linked to.
Actual Behavior
An error is thrown:
cannot apply alias for expr other than Column or AsEnum
Versions
Tested on 1.1.0
The text was updated successfully, but these errors were encountered: