mirror of
https://github.com/jackc/pgx.git
synced 2025-05-12 10:29:49 +00:00
To aid in composability, these methods no longer write their own length. This is especially useful for text formatted arrays and may be useful for future database/sql compatibility. It also makes the code a little simpler as the types no longer have to compute their own size. Along with this, these methods cannot encode NULL. They now return a boolean if they are NULL. This also benefits text array encoding as numeric arrays require NULL to be exactly `NULL` while string arrays require NULL to be `"NULL"`.
32 lines
710 B
Go
32 lines
710 B
Go
package pgtype
|
|
|
|
import (
|
|
"io"
|
|
)
|
|
|
|
type VarcharArray TextArray
|
|
|
|
func (dst *VarcharArray) ConvertFrom(src interface{}) error {
|
|
return (*TextArray)(dst).ConvertFrom(src)
|
|
}
|
|
|
|
func (src *VarcharArray) AssignTo(dst interface{}) error {
|
|
return (*TextArray)(src).AssignTo(dst)
|
|
}
|
|
|
|
func (dst *VarcharArray) DecodeText(src []byte) error {
|
|
return (*TextArray)(dst).DecodeText(src)
|
|
}
|
|
|
|
func (dst *VarcharArray) DecodeBinary(src []byte) error {
|
|
return (*TextArray)(dst).DecodeBinary(src)
|
|
}
|
|
|
|
func (src *VarcharArray) EncodeText(w io.Writer) (bool, error) {
|
|
return (*TextArray)(src).EncodeText(w)
|
|
}
|
|
|
|
func (src *VarcharArray) EncodeBinary(w io.Writer) (bool, error) {
|
|
return (*TextArray)(src).encodeBinary(w, VarcharOID)
|
|
}
|