Embedded structs in Go are not automatically promoted to the containing struct. No explicit support for them has been added to SQLair before so they are not currently supported.
This PR adds support for arbitrary levels of embedded structs. All fields in the embedded structs will be promoted to the top level.
You will now be able to do:
type Embedded struct {
F int `db:"embeddedColName"`
}
type S struct {
Embedded
}
stmt, err := sqlair.Prepare("SELECT &S.embeddedColName FROM t", S{})
Embedded structs in Go are not automatically promoted to the containing struct. No explicit support for them has been added to SQLair before so they are not currently supported.
This PR adds support for arbitrary levels of embedded structs. All fields in the embedded structs will be promoted to the top level.
You will now be able to do:
Also: