Post

Phil Eaton
Phil Eaton@eatonphil·
For INSERT-heavy workloads in Go, you may want to switch database drivers. For PostgreSQL and SQLite, the popular drivers are 20-76% slower for this workload in my tests. Some driver developers have reported issues with database/sql as an interface. notes.eatonphil.com/2023-10-05-go-…
Phil Eaton tweet media
English
10
16
122
23.9K
Phil Eaton
Phil Eaton@eatonphil·
@mikeschinkel Since sqlc uses database/sql, that would also go on the list of: consider not using for insert heavy workloads. :)
English
2
0
0
122
sqlc
sqlc@sqlcdev·
@mikeschinkel @eatonphil @sqlc You're correct that pgx is only for PostgreSQL databases. SQLite support in sqlc assumes you're using database/sql. Supporting alternative interfaces isn't impossible but would probably require effort from those projects' maintainers.
English
1
0
1
38
Mike Schinkel
Mike Schinkel@mikeschinkel·
@sqlcdev @eatonphil @sqlc Thanks for the response. Any chance of providing interfaces that would allow individual developers to make connectors?
English
1
0
0
43
sqlc
sqlc@sqlcdev·
@mikeschinkel @eatonphil @sqlc We provide a codegen plugin interface, but it's a couple levels higher than the database driver. So to write your own plugin you'd need to re-implement or extract most of what we've done internally for Go codegen, which is unfortunate.
English
1
0
0
46
Mike Schinkel
Mike Schinkel@mikeschinkel·
@sqlcdev @eatonphil @sqlc Looking forward to it. BTW, discovered sqlc recently, and LOVE it. I have been doing SQL for over 2 decades but Go for only 1/4th that long, so it really scratches my itch.
English
1
0
1
59
sqlc
sqlc@sqlcdev·
@mikeschinkel @eatonphil @sqlc In case it's still relevant, we released sqlc-gen-go which is the sqlc internal Go codegen package extracted for use as an external plugin. Forking and modifying it to support alternative SQLite drivers should be easier than forking the entirety of sqlc. github.com/sqlc-dev/sqlc-…
English
1
0
1
179
Mike Schinkel
Mike Schinkel@mikeschinkel·
@sqlcdev @eatonphil @sqlc Cool! Thank you for following up. I am in the midst of a different project, but will definitely circle back around when I go back that other project.
English
0
0
0
21
Paylaş