mirror of https://github.com/jackc/pgx.git
Try wrapping scan target before sql.Scanner
This allows wrappers to directly avoid the slow sql.Scanner interface.query-exec-mode
parent
5ed95dcd1c
commit
0ddf9e3b4b
|
@ -906,14 +906,6 @@ func (ci *ConnInfo) PlanScan(oid uint32, formatCode int16, target interface{}) S
|
|||
if plan := dt.Codec.PlanScan(ci, oid, formatCode, target, false); plan != nil {
|
||||
return plan
|
||||
}
|
||||
|
||||
if _, ok := target.(*interface{}); ok {
|
||||
return &pointerEmptyInterfaceScanPlan{codec: dt.Codec, ci: ci, oid: oid, formatCode: formatCode}
|
||||
}
|
||||
|
||||
if _, ok := target.(sql.Scanner); ok {
|
||||
return &scanPlanCodecSQLScanner{c: dt.Codec, ci: ci, oid: oid, formatCode: formatCode}
|
||||
}
|
||||
}
|
||||
|
||||
for _, f := range ci.TryWrapScanPlanFuncs {
|
||||
|
@ -927,6 +919,16 @@ func (ci *ConnInfo) PlanScan(oid uint32, formatCode int16, target interface{}) S
|
|||
}
|
||||
}
|
||||
|
||||
if dt != nil {
|
||||
if _, ok := target.(*interface{}); ok {
|
||||
return &pointerEmptyInterfaceScanPlan{codec: dt.Codec, ci: ci, oid: oid, formatCode: formatCode}
|
||||
}
|
||||
|
||||
if _, ok := target.(sql.Scanner); ok {
|
||||
return &scanPlanCodecSQLScanner{c: dt.Codec, ci: ci, oid: oid, formatCode: formatCode}
|
||||
}
|
||||
}
|
||||
|
||||
if _, ok := target.(sql.Scanner); ok {
|
||||
return &scanPlanSQLScanner{formatCode: formatCode}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue