Add pgtype.Record and prerequisite restructuring
Because reading a record type requires the decoder to be able to look up oid to type mapping and types such as hstore have types that are not fixed between different PostgreSQL servers it was necessary to restructure the pgtype system so all encoders and decodes take a *ConnInfo that includes oid/name/type information.
This commit is contained in:
+8
-8
@@ -28,18 +28,18 @@ func (src *OidValue) AssignTo(dst interface{}) error {
|
||||
return (*pguint32)(src).AssignTo(dst)
|
||||
}
|
||||
|
||||
func (dst *OidValue) DecodeText(src []byte) error {
|
||||
return (*pguint32)(dst).DecodeText(src)
|
||||
func (dst *OidValue) DecodeText(ci *ConnInfo, src []byte) error {
|
||||
return (*pguint32)(dst).DecodeText(ci, src)
|
||||
}
|
||||
|
||||
func (dst *OidValue) DecodeBinary(src []byte) error {
|
||||
return (*pguint32)(dst).DecodeBinary(src)
|
||||
func (dst *OidValue) DecodeBinary(ci *ConnInfo, src []byte) error {
|
||||
return (*pguint32)(dst).DecodeBinary(ci, src)
|
||||
}
|
||||
|
||||
func (src OidValue) EncodeText(w io.Writer) (bool, error) {
|
||||
return (pguint32)(src).EncodeText(w)
|
||||
func (src OidValue) EncodeText(ci *ConnInfo, w io.Writer) (bool, error) {
|
||||
return (pguint32)(src).EncodeText(ci, w)
|
||||
}
|
||||
|
||||
func (src OidValue) EncodeBinary(w io.Writer) (bool, error) {
|
||||
return (pguint32)(src).EncodeBinary(w)
|
||||
func (src OidValue) EncodeBinary(ci *ConnInfo, w io.Writer) (bool, error) {
|
||||
return (pguint32)(src).EncodeBinary(ci, w)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user