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

chore: update pgx to v5.6.0 #23

Closed
wants to merge 1 commit into from
Closed

Conversation

Mazafard
Copy link
Contributor

Summary

This issue aims to address the need to upgrade the pgx library to v5. This update is crucial for leveraging the latest features, improvements, and security patches offered by the newer version of this library.

Details

The following updates are proposed:

  1. Upgrade pgx to v5:
    • Update import statement in adapter.go from github.com/jackc/pgx/v4/stdlib to github.com/jackc/pgx/v5/stdlib.
    • Modify the go.mod file to require github.com/jackc/pgx/v5 v5.6.0.

Changes:

adapter.go:

@@ -30,7 +30,7 @@ import (
	"github.com/casbin/casbin/v2/model"		"github.com/casbin/casbin/v2/model"
	"github.com/casbin/ent-adapter/ent"		"github.com/casbin/ent-adapter/ent"
	_ "github.com/go-sql-driver/mysql"		_ "github.com/go-sql-driver/mysql"
-	_ "github.com/jackc/pgx/v4/stdlib"
+	_ "github.com/jackc/pgx/v5/stdlib"
	_ "github.com/lib/pq"		_ "github.com/lib/pq"
	//_ "github.com/mattn/go-sqlite3"		//_ "github.com/mattn/go-sqlite3"

go.mod:

@@ -6,7 +6,7 @@ require (
	entgo.io/ent v0.8.0		entgo.io/ent v0.8.0
	github.com/casbin/casbin/v2 v2.29.2		github.com/casbin/casbin/v2 v2.29.2
	github.com/go-sql-driver/mysql v1.5.1-0.20200311113236-681ffa848bae		github.com/go-sql-driver/mysql v1.5.1-0.20200311113236-681ffa848bae
-	github.com/jackc/pgx/v4 v4.18.1
+	github.com/jackc/pgx/v5 v5.6.0
	github.com/lib/pq v1.10.2		github.com/lib/pq v1.10.2
	//github.com/mattn/go-sqlite3 v1.14.6		//github.com/mattn/go-sqlite3 v1.14.6
	github.com/pkg/errors v0.9.1		github.com/pkg/errors v0.9.1

Rationale

  • The pgx library v5 introduces significant improvements and new features that we want to leverage.
  • Keeping dependencies up-to-date ensures compatibility, security, and performance improvements.

Testing

  • Ensure all existing tests pass.
  • Manually test the integration with PostgreSQL and MySQL to verify that there are no regressions.

Additional Notes

Please review the proposed changes and provide feedback.

Related Issue

@hsluoyz
Copy link
Member

hsluoyz commented Jul 20, 2024

@Mazafard CI failed. Can you test all CIs in your fork before making the PR?

@hsluoyz
Copy link
Member

hsluoyz commented Jul 26, 2024

Replaced by: #24

@hsluoyz hsluoyz closed this Jul 26, 2024
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.

2 participants