8000 Question: how to select and scan a user and all his pets(O2M) into a struct? · Issue #220 · ent/ent · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Question: how to select and scan a user and all his pets(O2M) into a struct? #220

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

Closed
kidlj opened this issue Dec 5, 2019 · 1 comment
Closed
Labels

Comments

@kidlj
Copy link
Contributor
kidlj commented Dec 5, 2019

Suppose that User and Pet has a O2M relation, and the following is the result type I want to scan into

type UserPets struct {
  Name string `json:"name",
  Age int `json:"age",
  Pets []Pet `json:"pets",
}

How to select and scan results into such a struct variable ?

Thanks.

@a8m a8m added the Question label Dec 5, 2019
@a8m
Copy link
Member
a8m commented Dec 5, 2019

Hey @kidlj, Eager-loading is currently under development and should be done soon.
See #91 for more details.

You're welcome to give feedback on the design in the linked issue.
Thanks

@a8m a8m closed this as completed Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0