2
0

Finish import of pgtype repo

Fix some tests that broke by merging repos
Tweak readme wording
This commit is contained in:
Jack Christensen
2021-12-04 13:33:09 -06:00
parent 7aeb42b80c
commit 7e13db4538
116 changed files with 294 additions and 686 deletions
+4 -4
View File
@@ -8,7 +8,7 @@ import (
"time"
"github.com/jackc/pgio"
"github.com/jackc/pgtype"
"github.com/jackc/pgx/v4/pgtype"
)
// PostgreSQL format codes
@@ -228,15 +228,15 @@ func encodePreparedStatementArgument(ci *pgtype.ConnInfo, buf []byte, oid uint32
// determination can be made.
func chooseParameterFormatCode(ci *pgtype.ConnInfo, oid uint32, arg interface{}) int16 {
switch arg := arg.(type) {
case pgtype.ParamFormatPreferrer:
return arg.PreferredParamFormat()
case pgtype.FormatSupport:
return arg.PreferredFormat()
case pgtype.BinaryEncoder:
return BinaryFormatCode
case string, *string, pgtype.TextEncoder:
return TextFormatCode
}
return ci.ParamFormatCodeForOID(oid)
return ci.FormatCodeForOID(oid)
}
func stripNamedType(val *reflect.Value) (interface{}, bool) {