mirror of
https://github.com/jackc/pgx.git
synced 2025-05-28 18:22:15 +00:00
PlanScan used to require the exact same value be used every time. While this was great for performance, on further consideration I think it is too much of a potential foot-gun. This moves back in the other direction. A plan tolerates a change in destination. It even detects a change in destination type and falls back to a new plan. Perfectly matched hot scan paths (e.g. PG int4 to Go int32) are still much faster than they were before this set of optimizations. The first scan of a destination that uses a decoder is faster due to not allocating. It's a little bit slower on subsequent runs than before this set of optimizations. But it is preferable to optimize for the most common scan targets (e.g. *int32, *int64, *string) over generic decoder destinations. In addition this fees pgx.connRows.Scan from having to check that the destination is unchanged.
pgtype
pgtype implements Go types for over 70 PostgreSQL types. pgtype is the type system underlying the
https://github.com/jackc/pgx PostgreSQL driver. These types support the binary format for enhanced performance with pgx.
They also support the database/sql Scan
and Value
interfaces and can be used with https://github.com/lib/pq.
Languages
Go
98.6%
HTML
1.2%
Shell
0.2%