dump support bool
This commit is contained in:
parent
263f9d3fa5
commit
c360c20aa5
12
engine.go
12
engine.go
|
@ -488,6 +488,18 @@ func (engine *Engine) dumpTables(tables []*core.Table, w io.Writer, tp ...core.D
|
||||||
switch reflect.TypeOf(d).Kind() {
|
switch reflect.TypeOf(d).Kind() {
|
||||||
case reflect.Slice:
|
case reflect.Slice:
|
||||||
temp += fmt.Sprintf(", %s", string(d.([]byte)))
|
temp += fmt.Sprintf(", %s", string(d.([]byte)))
|
||||||
|
case reflect.Int16, reflect.Int8, reflect.Int32, reflect.Int64, reflect.Int:
|
||||||
|
if col.SQLType.Name == core.Bool {
|
||||||
|
temp += fmt.Sprintf(", %v", strconv.FormatBool(reflect.ValueOf(d).Int() > 0))
|
||||||
|
} else {
|
||||||
|
temp += fmt.Sprintf(", %v", d)
|
||||||
|
}
|
||||||
|
case reflect.Uint, reflect.Uint8, reflect.Uint16, reflect.Uint32, reflect.Uint64:
|
||||||
|
if col.SQLType.Name == core.Bool {
|
||||||
|
temp += fmt.Sprintf(", %v", strconv.FormatBool(reflect.ValueOf(d).Uint() > 0))
|
||||||
|
} else {
|
||||||
|
temp += fmt.Sprintf(", %v", d)
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
temp += fmt.Sprintf(", %v", d)
|
temp += fmt.Sprintf(", %v", d)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue