Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion dump.go
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ func (table *table) Init() error {
func reflectColumnType(tp *sql.ColumnType) reflect.Type {
// reflect for ScanType
switch tp.ScanType().Kind() {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64, reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
return reflect.TypeOf(sql.NullInt64{})
case reflect.Float32, reflect.Float64:
return reflect.TypeOf(sql.NullFloat64{})
Expand Down Expand Up @@ -531,6 +531,12 @@ func (table *table) RowBuffer() *bytes.Buffer {
} else {
fmt.Fprintf(&b, "_binary '%s'", sanitize(string(*s)))
}
case *sql.NullTime:
if s.Valid {
fmt.Fprintf(&b, "'%s'", s.Time.Format(time.RFC3339))
} else {
b.WriteString(nullType)
}
default:
fmt.Fprintf(&b, "'%s'", value)
}
Expand Down