pgx/generic_binary.go
Jack Christensen 6e21cb00fe 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.
2017-03-18 12:01:16 -05:00

30 lines
668 B
Go

package pgtype
import (
"io"
)
// GenericBinary is a placeholder for binary format values that no other type exists
// to handle.
type GenericBinary Bytea
func (dst *GenericBinary) Set(src interface{}) error {
return (*Bytea)(dst).Set(src)
}
func (dst *GenericBinary) Get() interface{} {
return (*Bytea)(dst).Get()
}
func (src *GenericBinary) AssignTo(dst interface{}) error {
return (*Bytea)(src).AssignTo(dst)
}
func (dst *GenericBinary) DecodeBinary(ci *ConnInfo, src []byte) error {
return (*Bytea)(dst).DecodeBinary(ci, src)
}
func (src GenericBinary) EncodeBinary(ci *ConnInfo, w io.Writer) (bool, error) {
return (Bytea)(src).EncodeBinary(ci, w)
}