Support new pgtype format preferences
This commit is contained in:
@@ -226,7 +226,9 @@ func encodePreparedStatementArgument(ci *pgtype.ConnInfo, buf []byte, oid uint32
|
||||
// argument to a prepared statement. It defaults to TextFormatCode if no
|
||||
// determination can be made.
|
||||
func chooseParameterFormatCode(ci *pgtype.ConnInfo, oid uint32, arg interface{}) int16 {
|
||||
switch arg.(type) {
|
||||
switch arg := arg.(type) {
|
||||
case pgtype.ParamFormatPreferrer:
|
||||
return arg.PreferredParamFormat()
|
||||
case pgtype.BinaryEncoder:
|
||||
return BinaryFormatCode
|
||||
case string, *string, pgtype.TextEncoder:
|
||||
|
||||
Reference in New Issue
Block a user