lib / pq

Pure Go Postgres driver for database/sql
https://pkg.go.dev/github.com/lib/pq
MIT License
9.04k stars 909 forks source link

all: switch internal API's to use driver.NamedValue instead of driver.Value #1068

Open kevinburke opened 2 years ago

kevinburke commented 2 years ago

database/sql defaults to using the QueryContext and ExecContext API's. Previously, we would need to allocate in order to convert the driver.NamedValue parameter that each of those accepts to a driver.Value. By using driver.NamedValue consistently internally, we can save allocations and improve performance.

See #1067 for a full set of benchmarks.