mirror of
https://github.com/jackc/pgx.git
synced 2025-05-31 11:42:24 +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
638 B
Go
30 lines
638 B
Go
package pgtype
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
// GenericText is a placeholder for text format values that no other type exists
|
|
// to handle.
|
|
type GenericText Text
|
|
|
|
func (dst *GenericText) Set(src interface{}) error {
|
|
return (*Text)(dst).Set(src)
|
|
}
|
|
|
|
func (dst *GenericText) Get() interface{} {
|
|
return (*Text)(dst).Get()
|
|
}
|
|
|
|
func (src *GenericText) AssignTo(dst interface{}) error {
|
|
return (*Text)(src).AssignTo(dst)
|
|
}
|
|
|
|
func (dst *GenericText) DecodeText(ci *ConnInfo, src []byte) error {
|
|
return (*Text)(dst).DecodeText(ci, src)
|
|
}
|
|
|
|
func (src GenericText) EncodeText(ci *ConnInfo, w io.Writer) (bool, error) {
|
|
return (Text)(src).EncodeText(ci, w)
|
|
}
|