Skip to content
New issue

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

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

Already on GitHub? # to your account

Support One to Many relationships when scanning #3

Open
dialtone opened this issue Jan 16, 2020 · 0 comments
Open

Support One to Many relationships when scanning #3

dialtone opened this issue Jan 16, 2020 · 0 comments

Comments

@dialtone
Copy link

I've read issue #2 but while I can see it working, it requires that each query also serializes json and then it's again de-serialized after the query.

Is there any plan or hint around how to support one-to-many relationships? For example supporting something like:

type (
    Address struct {
        Line1 string `db:"line_1"`
        City  string
    }
    User struct {
        ID      uint32
        Name    string
        Email   string
        Address []Address `scan:"follow"` // follow inspects the struct and adds the fields without being dot notated. 
    }
)

and having it just work.

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

No branches or pull requests

1 participant