I failed.
The current #golang generics implementation is quite limited. For something usable, I need covariance, variadic generics, parameterized methods, or tuples as first-class types. The best I could do is to map with reflection query results onto structs but sqlx already can do that.
Despite a failure to do anything good with generics, I found an interesting hack (with reflection and unsafe pointer comparison) when you can directly pass struct fields to be used in queries.
I wonder if that can be useful in practice. I like that you can press "go to references" on the field in IDE and find all queries that fetch the field.
I might actually get something useful out of it. The same reflection on fields allows to make type-safe conditions, which is rare for Go ORMs. In the example below, type checker knows that the field `user.age` is int and requires the second argument also be an int. Finally, a place where generics do fit and help.
My main concern is that while it accounts for 80% use cases, it's not as flexible as unconstrained query builders like squirrel. What if you want to have subexpressions? Joins? Some DB-specific syntax? Server-side functions? SQL is too flexible to reasonably fit it into Go.