mirror of
https://github.com/jackc/pgx.git
synced 2025-04-27 21:25:53 +00:00
Methods defined on T are also available on *T. Thought this technically changes the interface, because *T will be automatically dereferenced as needed it shouldn't be a breaking change. See a8802b16cc593842f5c69b0f7cfb0de11d5cd3a8 for similar change.
40 lines
983 B
Go
40 lines
983 B
Go
package pgtype
|
|
|
|
import (
|
|
"database/sql/driver"
|
|
)
|
|
|
|
// 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, buf []byte) ([]byte, error) {
|
|
return (Bytea)(src).EncodeBinary(ci, buf)
|
|
}
|
|
|
|
// Scan implements the database/sql Scanner interface.
|
|
func (dst *GenericBinary) Scan(src interface{}) error {
|
|
return (*Bytea)(dst).Scan(src)
|
|
}
|
|
|
|
// Value implements the database/sql/driver Valuer interface.
|
|
func (src GenericBinary) Value() (driver.Value, error) {
|
|
return (Bytea)(src).Value()
|
|
}
|