db
db copied to clipboard
Other way to select in querybuilder: SelectFromSlice or SelectFromStruct
Because I want only the fields that are in my model (which my own representation of some joined tables) I don't want to use * because I don't want the fields I don't need. So I have to code the by hand and pass them to the Select line in this example: q = sess.Select("id", "name").From("accounts").
But what if there was a SelectFromSlice (or something), then I could easily pass a slice to it with all my columns inside. The big advantage would be, that I don't have to code the filling of the slice by hand, but can fill it with reflection. Saves me a lot of time. Or if there was a SelectFromStruct, where this automatically happens.