2
0

Add pgtype GenericText and GenericBinary

Rows.Values uses this for unknown types.
This commit is contained in:
Jack Christensen
2017-03-11 20:28:14 -06:00
parent aac8fd66f2
commit 3391818847
3 changed files with 60 additions and 7 deletions
+29
View File
@@ -0,0 +1,29 @@
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(src []byte) error {
return (*Text)(dst).DecodeText(src)
}
func (src GenericText) EncodeText(w io.Writer) (bool, error) {
return (Text)(src).EncodeText(w)
}