Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
This time it was related to speeding up our development (and testing!) workflow when using PostgreSQL as a persistent datastore. For context, we have been successfully using database/sql and jmoiron/sqlx, and both can get the work done but I'm always trying to find better tools to improve what we have. I've been doing this investigation for a few months already, and I did find some packages and tools, but because of the amount of options I haven't really had time to try them all. In the end what I'm looking for is tools/packages that:
jackc/pgx PostgreSQL driver and toolkit for Go
This driver has been on my radar for months already, I actually used it for the blog series Implementing Complex Pipelines in Go, the cool thing about pgx is that it also implements the interface types defined in database/sql so replacing what we have (which uses lib/pq) should be, in theory, not that difficult.
golang-migrate/migrate Database migrations. CLI and Golang library.
kyleconroy/sqlc Generate type safe Go from SQL
Masterminds/squirrel Fluent SQL generation for golang
ory/dockertest Write better integration tests! Dockertest helps you boot up ephemeral docker images for your Go tests with minimal work
I will continue exploring sqlc as well as the other tools/packages mentioned above, another thing I'm also investigating is something similar to factory_bot for speeding up the default values required when testing PostgreSQL-related methods.