Load items from database using reflection

Hello,

I am working with database and am trying to create generic functions for handling structures.
I have Create() and Insert() implemented and want to implement Select() having the same layout:
function_name (table_name, structure)… e.g.:
handler.Create("cars", car{})
handler.Insert("cars", car{color:"blue"})
Please check the implementation on google playground..

Now, I would like to do the same thing with Select() but I am struggling with pointer retrieval.
func (d *databaseHandler) Select(table string, row interface{}) ([]interface{}, error)
Please check the current function code on google playground.

Can someone please point me to right direction?
Thanks!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.