georgysavva / scany

Library for scanning data from a database into Go structs and more
MIT License
1.23k stars 67 forks source link

Prototype generic methods #138

Closed RangelReale closed 2 weeks ago

RangelReale commented 4 weeks ago

I created this PR with some prototype generic methods, so we don't need to pre-create the slices or output structs, which is done most of the times.

I just added functions with "Type" suffixes and a type parameter, this is not a final PR, just to open discussions about the viability and usefulness of it.

georgysavva commented 3 weeks ago

Hi, thank you for submitting this pull request. In my opinion, the benefits these methods provide don't justify the complication of the library's API

RangelReale commented 2 weeks ago

Yes I think so too, until Go have separate type parameters for struct methods, there's no way of doing a good generic API.