Add support for embedded/nested structs to SQLair input and output expressions. Embedded structs are structs included without a field name and nested structs are those included with a field name.
e.g. embedded:
type S struct {
E
}
and nested:
type S struct {
e E
}
A SQLair output expression can now be something like &MyStruct.myfieldtag where the tagged field was nested/embedded multiple layers deep. The tags of the inner structs are referenced as if they were tags of the top level struct. An asterisk expression (e.g. &MyStruct.*) will now include all embedded/nested tagged fields in a struct.
Pointers to nested structs are also handled as above.
If the field containing a nested struct has a tag on it then it will be ignored (unless the struct in the field implements sql.Scanner).
If there are clashing tags between nested structs an error will be returned from Prepare.
Add support for embedded/nested structs to SQLair input and output expressions. Embedded structs are structs included without a field name and nested structs are those included with a field name. e.g. embedded:
and nested:
A SQLair output expression can now be something like
&MyStruct.myfieldtag
where the tagged field was nested/embedded multiple layers deep. The tags of the inner structs are referenced as if they were tags of the top level struct. An asterisk expression (e.g.&MyStruct.*
) will now include all embedded/nested tagged fields in a struct.Pointers to nested structs are also handled as above.
If the field containing a nested struct has a tag on it then it will be ignored (unless the struct in the field implements
sql.Scanner
).If there are clashing tags between nested structs an error will be returned from
Prepare
.