go-ozzo/ozzo-routing

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

Opened this issue · 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?