2
0

Expose wrap functions on ConnInfo

- Remove rarely used ScanPlan.Scan arguments
- Plus other refactorings and fixes that fell out of this change.
- Plus rows Scan now handles checking for changed type.
This commit is contained in:
Jack Christensen
2022-01-22 17:48:31 -06:00
parent 322bfedc60
commit 5ed95dcd1c
40 changed files with 352 additions and 435 deletions
+4 -4
View File
@@ -189,7 +189,7 @@ func (c TextCodec) DecodeValue(ci *ConnInfo, oid uint32, format int16, src []byt
type scanPlanTextAnyToString struct{}
func (scanPlanTextAnyToString) Scan(ci *ConnInfo, oid uint32, formatCode int16, src []byte, dst interface{}) error {
func (scanPlanTextAnyToString) Scan(src []byte, dst interface{}) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
}
@@ -202,7 +202,7 @@ func (scanPlanTextAnyToString) Scan(ci *ConnInfo, oid uint32, formatCode int16,
type scanPlanAnyToNewByteSlice struct{}
func (scanPlanAnyToNewByteSlice) Scan(ci *ConnInfo, oid uint32, formatCode int16, src []byte, dst interface{}) error {
func (scanPlanAnyToNewByteSlice) Scan(src []byte, dst interface{}) error {
p := (dst).(*[]byte)
if src == nil {
*p = nil
@@ -216,7 +216,7 @@ func (scanPlanAnyToNewByteSlice) Scan(ci *ConnInfo, oid uint32, formatCode int16
type scanPlanTextAnyToRune struct{}
func (scanPlanTextAnyToRune) Scan(ci *ConnInfo, oid uint32, formatCode int16, src []byte, dst interface{}) error {
func (scanPlanTextAnyToRune) Scan(src []byte, dst interface{}) error {
if src == nil {
return fmt.Errorf("cannot scan null into %T", dst)
}
@@ -234,7 +234,7 @@ func (scanPlanTextAnyToRune) Scan(ci *ConnInfo, oid uint32, formatCode int16, sr
type scanPlanTextAnyToTextScanner struct{}
func (scanPlanTextAnyToTextScanner) Scan(ci *ConnInfo, oid uint32, formatCode int16, src []byte, dst interface{}) error {
func (scanPlanTextAnyToTextScanner) Scan(src []byte, dst interface{}) error {
scanner := (dst).(TextScanner)
if src == nil {