The sqltype package is a set of types that embraces the
sql.Scanner interface from database/sql to other types,
e.g. time.Time with sqltype.NullTime and time.Duration
with sqltype.NullDuration.
Prior art
Parts of this are taken from the lib/pq library, e.g.
the sqltype.NullTime has been take from
here.
type NullDuration struct {
Duration time.Duration Valid bool// Valid is true if Duration is not NULL}
NullDuration represents a time.Duration that may be null. NullDuration implements the
sql.Scanner interface so it can be used as a scan destination, similar to
sql.NullString.
type NullTime struct {
Time time.Time Valid bool// Valid is true if Time is not NULL}
NullTime represents a time.Time that may be null. NullTime implements the
sql.Scanner interface so it can be used as a scan destination, similar to
sql.NullString.