mirror of https://github.com/jackc/pgx.git
Fix encode plan names
parent
f573cde09c
commit
6cb3439492
|
@ -113,14 +113,14 @@ func (BoolCodec) PlanEncode(ci *ConnInfo, oid uint32, format int16, value interf
|
||||||
case bool:
|
case bool:
|
||||||
return encodePlanBoolCodecBinaryBool{}
|
return encodePlanBoolCodecBinaryBool{}
|
||||||
case BoolValuer:
|
case BoolValuer:
|
||||||
return encodePlanBoolCodecBinaryBoolScanner{}
|
return encodePlanBoolCodecBinaryBoolValuer{}
|
||||||
}
|
}
|
||||||
case TextFormatCode:
|
case TextFormatCode:
|
||||||
switch value.(type) {
|
switch value.(type) {
|
||||||
case bool:
|
case bool:
|
||||||
return encodePlanBoolCodecTextBool{}
|
return encodePlanBoolCodecTextBool{}
|
||||||
case BoolValuer:
|
case BoolValuer:
|
||||||
return encodePlanBoolCodecTextBoolScanner{}
|
return encodePlanBoolCodecTextBoolValuer{}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,9 +141,9 @@ func (encodePlanBoolCodecBinaryBool) Encode(value interface{}, buf []byte) (newB
|
||||||
return buf, nil
|
return buf, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type encodePlanBoolCodecTextBoolScanner struct{}
|
type encodePlanBoolCodecTextBoolValuer struct{}
|
||||||
|
|
||||||
func (encodePlanBoolCodecTextBoolScanner) Encode(value interface{}, buf []byte) (newBuf []byte, err error) {
|
func (encodePlanBoolCodecTextBoolValuer) Encode(value interface{}, buf []byte) (newBuf []byte, err error) {
|
||||||
b, err := value.(BoolValuer).BoolValue()
|
b, err := value.(BoolValuer).BoolValue()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -162,9 +162,9 @@ func (encodePlanBoolCodecTextBoolScanner) Encode(value interface{}, buf []byte)
|
||||||
return buf, nil
|
return buf, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
type encodePlanBoolCodecBinaryBoolScanner struct{}
|
type encodePlanBoolCodecBinaryBoolValuer struct{}
|
||||||
|
|
||||||
func (encodePlanBoolCodecBinaryBoolScanner) Encode(value interface{}, buf []byte) (newBuf []byte, err error) {
|
func (encodePlanBoolCodecBinaryBoolValuer) Encode(value interface{}, buf []byte) (newBuf []byte, err error) {
|
||||||
b, err := value.(BoolValuer).BoolValue()
|
b, err := value.(BoolValuer).BoolValue()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in New Issue