mirror of
https://github.com/jackc/pgx.git
synced 2025-04-28 14:07:51 +00:00
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.
30 lines
668 B
Go
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)
|
|
}
|