ozzo-routing icon indicating copy to clipboard operation
ozzo-routing copied to clipboard

Can we use this feature to populate all nested struct fields?

Open kolkov opened this issue 4 years ago • 0 comments

Hi! I try to find the way to populate DDD aggregate with simple joined query. At this moment it possible only by giving all needed fields in select query. I whant to use this way to populate all struct with nested struct fields at once. https://stackoverflow.com/a/13153422

For example:

type Wagon struct {
    Wagon
    State WagonState
    Location WagonLocation
}

with

...
Select(
    "w.*",
    "ws.*",
    "wl.*"
).From("wagon w").
InnerJoin("wagon_state ws", dbx.NewExp("ws.id=w.state_id")).
InnerJoin("wagon_location wl", dbx.NewExp("wl.id=w.location_id")).
...

Is it possible to add to this lib?

kolkov avatar Jan 09 '21 00:01 kolkov