Merge branch 'bobheadxi-master'
This commit is contained in:
@@ -189,7 +189,15 @@ func encodePreparedStatementArgument(ci *pgtype.ConnInfo, buf []byte, oid pgtype
|
|||||||
|
|
||||||
sp := len(buf)
|
sp := len(buf)
|
||||||
buf = pgio.AppendInt32(buf, -1)
|
buf = pgio.AppendInt32(buf, -1)
|
||||||
argBuf, err := value.(pgtype.BinaryEncoder).EncodeBinary(ci, buf)
|
var argBuf []byte
|
||||||
|
switch valueEncoder := value.(type) {
|
||||||
|
case pgtype.BinaryEncoder:
|
||||||
|
argBuf, err = valueEncoder.EncodeBinary(ci, buf)
|
||||||
|
case pgtype.TextEncoder:
|
||||||
|
argBuf, err = valueEncoder.EncodeText(ci, buf)
|
||||||
|
default:
|
||||||
|
return nil, fmt.Errorf("invalid encode type %v", valueEncoder)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user