From 322bfedc600692de7e6deb257bed0767c210fe59 Mon Sep 17 00:00:00 2001 From: Jack Christensen Date: Sat, 22 Jan 2022 16:20:37 -0600 Subject: [PATCH] Remove old SQL scanner integration --- pgtype/pgtype.go | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/pgtype/pgtype.go b/pgtype/pgtype.go index 8aad4fb7..73bd249c 100644 --- a/pgtype/pgtype.go +++ b/pgtype/pgtype.go @@ -186,18 +186,15 @@ type ConnInfo struct { // to be built up. There are default functions placed in this slice by NewConnInfo(). In most cases these functions // should run last. i.e. Additional functions should typically be prepended not appended. TryWrapScanPlanFuncs []TryWrapScanPlanFunc - - preferAssignToOverSQLScannerTypes map[reflect.Type]struct{} } func NewConnInfo() *ConnInfo { ci := &ConnInfo{ - oidToDataType: make(map[uint32]*DataType), - nameToDataType: make(map[string]*DataType), - reflectTypeToName: make(map[reflect.Type]string), - oidToFormatCode: make(map[uint32]int16), - oidToResultFormatCode: make(map[uint32]int16), - preferAssignToOverSQLScannerTypes: make(map[reflect.Type]struct{}), + oidToDataType: make(map[uint32]*DataType), + nameToDataType: make(map[string]*DataType), + reflectTypeToName: make(map[reflect.Type]string), + oidToFormatCode: make(map[uint32]int16), + oidToResultFormatCode: make(map[uint32]int16), TryWrapEncodePlanFuncs: []TryWrapEncodePlanFunc{ TryWrapDerefPointerEncodePlan, @@ -402,12 +399,6 @@ func (ci *ConnInfo) FormatCodeForOID(oid uint32) int16 { return TextFormatCode } -// PreferAssignToOverSQLScannerForType makes a sql.Scanner type use the AssignTo scan path instead of sql.Scanner. -// This is primarily for efficient integration with 3rd party numeric and UUID types. -func (ci *ConnInfo) PreferAssignToOverSQLScannerForType(value interface{}) { - ci.preferAssignToOverSQLScannerTypes[reflect.TypeOf(value)] = struct{}{} -} - // EncodePlan is a precompiled plan to encode a particular type into a particular OID and format. type EncodePlan interface { // Encode appends the encoded bytes of value to buf. If value is the SQL value NULL then append nothing and return