go-testdb
go-testdb copied to clipboard
Support for returning sql.NullString
At present either a string
or time.Time
is returned for the driver.Value
within RowsFromCSVString
. It would be nice to add support returning a sql.NullString
.
It could look something like:
type testDriver struct {
// as is
enableNullParsing bool
}
// Within RowsFromCSVString...
if d.enableTimeParsing {
// as is
} else if d.enableNullParsing && v == "" {
row[i] = sql.NullString{}
} else {
row[i] = v
}
Happy to knock this up into a PR if it's something you'd like to see added.