Skip to main content

Module select_projection_has_one

Module select_projection_has_one 

Source
Expand description

.select(...) projection through a HasOne relation field.

Per PR #827, projecting a BelongsTo works because the macro emits IntoExpr<TargetModel> for the relation field-struct and the lowering walk routes the reference through build_relation_subquery. HasOne uses the same field-struct type (<Target as Relation>::OneField) and build_relation_subquery already has a HasOne branch (used by .include), so the case works end-to-end with no further production code change.

Modulesยง

select_has_one_basic
select_has_one_first
select_has_one_with_filter