2
0

Refactor format code choosing

This commit is contained in:
Jack Christensen
2019-08-25 00:38:50 -05:00
parent 8f080dcbb2
commit 169632e028
5 changed files with 19 additions and 43 deletions
+1 -7
View File
@@ -217,13 +217,7 @@ func chooseParameterFormatCode(ci *pgtype.ConnInfo, oid uint32, arg interface{})
return TextFormatCode
}
if dt, ok := ci.DataTypeForOID(oid); ok {
if _, ok := dt.Value.(pgtype.BinaryEncoder); ok {
return BinaryFormatCode
}
}
return TextFormatCode
return ci.ParamFormatCodeForOID(oid)
}
func stripNamedType(val *reflect.Value) (interface{}, bool) {