randallmlough/pgxscan

Support One to Many relationships when scanning

Opened this issue · 0 comments

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.