Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kolkov opened this issue Jan 9, 2021 · 0 comments
Open

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

kolkov opened this issue Jan 9, 2021 · 0 comments

Comments

@kolkov
Copy link
Contributor

kolkov commented Jan 9, 2021

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant