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

Update pgx to v5 #27

Merged
merged 4 commits into from
Jul 16, 2024
Merged

Update pgx to v5 #27

merged 4 commits into from
Jul 16, 2024

Conversation

michiomochi
Copy link
Contributor

@michiomochi michiomochi commented Jul 16, 2024

pgxをv4.18.3からv5.6.0へアップデートします。
v4からv5のChangelogは以下の通りです。
https://github.com/jackc/pgx/blob/master/CHANGELOG.md#v500-september-17-2022

qgでは以下の軽微な影響がありました。

  • merged packages
    • github.com/jackc/pgtype, github.com/jackc/pgconn, and github.com/jackc/pgproto3 are now included in the main github.com/jackc/pgx repository. Previously there was confusion as to where issues should be reported, additional release work due to releasing multiple packages, and less clear changelogs.

  • pgxpool
    • Connect and ConnectConfig have been renamed to New and NewWithConfig respectively. The LazyConnect option has been removed. Pools always lazily connect.

@@ -16,11 +16,9 @@ jobs:
# - macOS-latest
# - windows-latest
go:
- "1.22"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新の3バージョンまでテストするようにしました。

@@ -40,7 +38,7 @@ jobs:
uses: actions/checkout@v4

- name: Lint
uses: golangci/golangci-lint-action@v4
uses: golangci/golangci-lint-action@v6
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ついでにv6へ上げました。

@@ -58,11 +58,9 @@ type Job struct {
// Queryer is interface for query
type Queryer interface {
Begin(ctx context.Context) (pgx.Tx, error)
BeginFunc(ctx context.Context, f func(pgx.Tx) error) (err error)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

特に内部で利用していないのに型定義をしているものがあったので不要なものを削除しました。

@@ -34,7 +34,7 @@ func openTestClientMaxConns(ctx context.Context, t testing.TB, maxConnections in
// make lifetime sufficiently long
config.MaxConnLifetime = 5 * time.Minute

pool, err := pgxpool.ConnectConfig(ctx, config)
pool, err := pgxpool.NewWithConfig(ctx, config)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

アップデートによる関数名変更です。

Copy link

@kazukousen kazukousen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🥇

@michiomochi
Copy link
Contributor Author

寿司ゆき:thanks

@michiomochi michiomochi merged commit 92238e8 into master Jul 16, 2024
6 checks passed
@michiomochi michiomochi deleted the pgx-v5 branch July 16, 2024 16:10
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