File tree 1 file changed +6
-0
lines changed
1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,12 @@ plan for scanning into the Go value. A Codec will support scanning into one or m
164
164
are interfaces rather than explicit types. For example, PointCodec can use any Go type that implements the PointScanner
165
165
and PointValuer interfaces.
166
166
167
+ If a Go value is not supported directly by a Codec then Map will try see if it is a sql.Scanner. If is then that
168
+ interface will be used to scan the value. Most sql.Scanners require the input to be in the text format (e.g. UUIDs and
169
+ numeric). However, pgx will typically have received the value in the binary format. In this case the binary value will be
170
+ parsed, reencoded as text, and then passed to the sql.Scanner. This may incur additional overhead for query results with
171
+ a large number of affected values.
172
+
167
173
If a Go value is not supported directly by a Codec then Map will try wrapping it with additional logic and try again.
168
174
For example, Int8Codec does not support scanning into a renamed type (e.g. type myInt64 int64). But Map will detect that
169
175
myInt64 is a renamed type and create a plan that converts the value to the underlying int64 type and then passes that to
You can’t perform that action at this time.
0 commit comments