-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace lib/pq with pgx/stdlib as postgres driver #512
Comments
Thanks for raising this issue! Is I see these
@dzbee Have you tried switching out the driver and running tests? Does anyone want to stay on |
Replacing the driver itself is as simple as swapping the package and changing the string identifier for the driver in There are a few other places where I wanted to respond to some of the issues you linked in the meantime:
|
I've confirmed that the happy path is working for our use case of using a file source for migrating a postgres database in app using https://github.com/nicheinc/migrate/tree/feature/pgx-support, and with minor updates to the expected error reporting in testing (in particular to include the SQL error code), that branch is also passing testing. I've opened up a PR: #517 |
Is your feature request related to a problem? Please describe.
The current postgres driver used by
migrate
islib/pq
, which is currently in maintenance mode. The maintainers oflib/pq
encourage users to change over topgx
. Beside the fact thatlib/pq
will eventually be disfavored relative topgx
in the community (if it's not already), dependence on thelib/pq
driver has blocked our org from upgrading to Go 1.15 (see outstandinglib/pq
branch), and we'd like to remove thelib/pq
dependency while continuing to usemigrate
.Describe the solution you'd like
I propose that
pgx/stdlib
replace thelib/pq
driver for providing postgres support formigrate
, in the spirit of the outlook outlined in the FAQ.Describe alternatives you've considered
Our current solution in our org is to perform the database migration with
migrate
and open a separate long-lived database connection for app support with thepgx/stdlib
driver to limit the impact of thelib/pq
dependency. But in the long term, the community undoubtedly will have to move away fromlib/pq
entirely.The text was updated successfully, but these errors were encountered: