coopernurse/gorp — pull request #191 by nelsam (2014-08-06 17:04:19+00:00)
Title: Make readStructColumns use the DbMap's TypeConverter, if it has one

In all of my codebases, I'm using TypeConverter for the purposes of converting structs into foreign keys, or custom types to standard Go types. Basically, if our types implement a certain interface, our TypeConverter automatically creates a CustomScanner for them, based on return values from the methods of that interface type.

In one of these codebases, we're using an sqlite3 database for all testing, and we wipe the database every time the tests are run, so it's pretty important that CreateTables() can work with our TypeConverter.

This pull request handles that by making readStructColumns use the type of the CustomScanner's Holder element if TypeConverter is non-nil and ToDb() returns true.