diff --git a/dump.go b/dump.go index 2411be1..e8a28e1 100644 --- a/dump.go +++ b/dump.go @@ -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{}) @@ -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) }