sqlstruct icon indicating copy to clipboard operation
sqlstruct copied to clipboard

Allow recursion using `,recurse`

Open SilverCory opened this issue 3 years ago • 3 comments

This allows sql:"..." to recurse into the struct tagged.

SilverCory avatar Mar 23 '21 23:03 SilverCory

Hm, wouldn't just ".." be more familiar looking?

kisielk avatar Mar 24 '21 00:03 kisielk

I was going along the lines of func(t ...T), if I saw .. I would thing up in the hierarchy not down

SilverCory avatar Mar 24 '21 00:03 SilverCory

But this isn't about varargs. If it needs to be any amount of dots, I believe a single . makes most sense since you are accessing a member of the struct, going down one level in the hierarchy, which is exactly what it looks like elsewhere in the language.

A different idea: add another tag-field. Kinda how for json we may write json:",omitempty" we could write sql:",recurse".

MMulthaupt avatar Jul 30 '21 13:07 MMulthaupt