2
0

Remove old SQL scanner integration

This commit is contained in:
Jack Christensen
2022-01-22 16:20:37 -06:00
parent aedf7d63e5
commit 322bfedc60
-9
View File
@@ -186,8 +186,6 @@ type ConnInfo struct {
// to be built up. There are default functions placed in this slice by NewConnInfo(). In most cases these functions // 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. // should run last. i.e. Additional functions should typically be prepended not appended.
TryWrapScanPlanFuncs []TryWrapScanPlanFunc TryWrapScanPlanFuncs []TryWrapScanPlanFunc
preferAssignToOverSQLScannerTypes map[reflect.Type]struct{}
} }
func NewConnInfo() *ConnInfo { func NewConnInfo() *ConnInfo {
@@ -197,7 +195,6 @@ func NewConnInfo() *ConnInfo {
reflectTypeToName: make(map[reflect.Type]string), reflectTypeToName: make(map[reflect.Type]string),
oidToFormatCode: make(map[uint32]int16), oidToFormatCode: make(map[uint32]int16),
oidToResultFormatCode: make(map[uint32]int16), oidToResultFormatCode: make(map[uint32]int16),
preferAssignToOverSQLScannerTypes: make(map[reflect.Type]struct{}),
TryWrapEncodePlanFuncs: []TryWrapEncodePlanFunc{ TryWrapEncodePlanFuncs: []TryWrapEncodePlanFunc{
TryWrapDerefPointerEncodePlan, TryWrapDerefPointerEncodePlan,
@@ -402,12 +399,6 @@ func (ci *ConnInfo) FormatCodeForOID(oid uint32) int16 {
return TextFormatCode 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. // EncodePlan is a precompiled plan to encode a particular type into a particular OID and format.
type EncodePlan interface { type EncodePlan interface {
// Encode appends the encoded bytes of value to buf. If value is the SQL value NULL then append nothing and return // Encode appends the encoded bytes of value to buf. If value is the SQL value NULL then append nothing and return