Skip to content
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

Migrate lib/pq to jackc/pgx/v5 #1403

Closed
wants to merge 3 commits into from

Conversation

pan93412
Copy link

@pan93412 pan93412 commented Jul 27, 2024

  • Tests are updated to reflect the latest PostgreSQL (15) default value.
  • Migrate lib/pq to pgx/v5's compatibility layer (to prevent rewriting too many things)
  • Update Go lockfiles to drop out lib/pq's dependencies

It has not been thoroughly tested (except for the tests). If there are any other real-world cases that can be used for testing, I would greatly appreciate it.

Fixed #996
Fixed #759

PostgreSQL 15.7 has a new default setting. To ensure the following jackc/pgx migration doesn't encounter any breaking changes, I've updated the default to the latest value provided by the lib/pq library.
Use stdlib compatibility layer to prevent possible breaking changes. Update TestSingleton's ThirdParty declaration to pgx/v5/stdlib.
@pan93412 pan93412 marked this pull request as ready for review July 27, 2024 09:57
@pan93412
Copy link
Author

Error: ../../../go/pkg/mod/github.com/jackc/pgx/v5@v5.6.0/pgconn/pgconn.go:159:57: undefined: errors.Join

Seems pgx/v5 has been adopted to a newer Go version.

@090809
Copy link
Contributor

090809 commented Sep 30, 2024

@stephenafamo can you check this?

@pan93412
Copy link
Author

@stephenafamo can you check this?

I don't think it can be merged soon. This project needs to upgrade the Go version to use pgx, which is somewhat breaking.

My branch currently matches the master branch of sqlboiler. You can use go get as a workaround. 🥰

@stephenafamo
Copy link
Collaborator

The driver is only used to read the database during generation and the user is free to use whatever *sql.DB they want at runtime.

Since there is no benefit to upgrading, we will just stick with lib/pq unless something else forces us to upgrade the Go version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for pgx driver pgx support
3 participants