Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
mei-rune committed Jun 1, 2024
1 parent 691b72a commit 2c5ea76
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion core/reflect.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ func makeColumnValue(name string, columnType *sql.ColumnType) func() (ptrValue i
return nil
}
}
case "varchar", "char", "text", "tinytext", "longtext":
case "varchar", "char", "text", "tinytext", "longtext", "character varying", "character":
//if nullable, ok := columnType.Nullable()

return func() (ptrValue interface{}, valueGet func() interface{}) {
Expand All @@ -312,6 +312,18 @@ func makeColumnValue(name string, columnType *sql.ColumnType) func() (ptrValue i
return nil
}
}
case "boolean", "bool", "bit":
//if nullable, ok := columnType.Nullable()

return func() (ptrValue interface{}, valueGet func() interface{}) {
var value sql.NullBool
return &value, func() interface{} {
if value.Valid {
return value.Bool
}
return nil
}
}
}

t := columnType.ScanType()
Expand Down

0 comments on commit 2c5ea76

Please sign in to comment.