2
0

Add pgtype.Numeric

This commit is contained in:
Jack Christensen
2017-04-01 23:33:04 -05:00
parent c5d247830c
commit 5ad2c4e2b9
5 changed files with 964 additions and 0 deletions
+10
View File
@@ -118,6 +118,16 @@ func chooseParameterFormatCode(ci *pgtype.ConnInfo, oid pgtype.Oid, arg interfac
if dt, ok := ci.DataTypeForOid(oid); ok {
if _, ok := dt.Value.(pgtype.BinaryEncoder); ok {
if arg, ok := arg.(driver.Valuer); ok {
if err := dt.Value.Set(arg); err != nil {
if value, err := arg.Value(); err == nil {
if _, ok := value.(string); ok {
return TextFormatCode
}
}
}
}
return BinaryFormatCode
}
}