Skip to content

Allow to fetch entity and all related ones #486

@Sytten

Description

@Sytten

Consider the following example (where a release has multiple release_links):

let result = releases::Entity::find()
                .find_with_related(release_links::Entity)
                .order_by_desc(releases::Column::ReleasedAt)
                .all(conn)
                .await?;

This returns a Vec<(Model, Vec<Model>)>. Changing .all to .one yields a Option<(Model, Option<Model>)>.
For a One-to-Many relation this is really weird, what is expected is Option<(Model, Vec<Model>)>.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions