Skip to content

Conversation

@kevinburke
Copy link
Contributor

@kevinburke kevinburke commented Nov 26, 2021

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.

Fixes #1067

@kevinburke kevinburke changed the title all: switch internal API's to use driver.NamedValue instead of driver.NamedValue all: switch internal API's to use driver.NamedValue instead of driver.Value Jan 26, 2022
….Value

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 lib#1067 for a full set of benchmarks.
@arp242 arp242 merged commit 4ff6b46 into lib:master Jan 3, 2026
37 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swap driver.Value for driver.NamedValue in internal APIs

2 participants