Skip to content

Commit

Permalink
Merge pull request #6 from vasayxtx/update-dependencies
Browse files Browse the repository at this point in the history
Switch to pgx/v5 and update minor versions for other dependencies
  • Loading branch information
vasayxtx authored Jan 16, 2025
2 parents 49e7ab1 + f7b8fb3 commit 46ebb34
Show file tree
Hide file tree
Showing 18 changed files with 168 additions and 257 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
cache: false

- name: Run GolangCI-Lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v6
with:
version: v1.56.1
version: v1.62.2
args: --timeout=5m
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea/
.vscode/
vendor/
coverage.out
17 changes: 0 additions & 17 deletions constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,23 +48,6 @@ const (
DialectMSSQL Dialect = "mssql"
)

// PostgresErrCode defines the type for Postgres error codes.
type PostgresErrCode string

// Postgres error codes (will be filled gradually).
const (
PgxErrCodeUniqueViolation PostgresErrCode = "23505"
PgxErrCodeDeadlockDetected PostgresErrCode = "40P01"
PgxErrCodeSerializationFailure PostgresErrCode = "40001"
PgxErrFeatureNotSupported PostgresErrCode = "0A000"

// nolint: staticcheck // lib/pq using is deprecated. Use pgx Postgres driver.
PostgresErrCodeUniqueViolation PostgresErrCode = "unique_violation"
// nolint: staticcheck // lib/pq using is deprecated. Use pgx Postgres driver.
PostgresErrCodeDeadlockDetected PostgresErrCode = "deadlock_detected"
PostgresErrCodeSerializationFailure PostgresErrCode = "serialization_failure"
)

// PostgresSSLMode defines possible values for Postgres sslmode connection parameter.
type PostgresSSLMode string

Expand Down
12 changes: 6 additions & 6 deletions dbrutil/retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,19 @@ import (
"reflect"
"testing"

"github.com/jackc/pgconn"
pg "github.com/jackc/pgx/v4/stdlib"
"github.com/jackc/pgx/v5/pgconn"
pg "github.com/jackc/pgx/v5/stdlib"
"github.com/stretchr/testify/require"

"github.com/acronis/go-dbkit"
_ "github.com/acronis/go-dbkit/pgx"
"github.com/acronis/go-dbkit/pgx"
)

// Test that retriable errors stays retriable even wrapped in Tx structures
func TestTxErrorsIsRetriable(t *testing.T) {
retriable := []dbkit.PostgresErrCode{
dbkit.PgxErrCodeDeadlockDetected,
dbkit.PgxErrCodeSerializationFailure,
retriable := []pgx.ErrCode{
pgx.ErrCodeDeadlockDetected,
pgx.ErrCodeSerializationFailure,
}

mkerr := func(code string) []error {
Expand Down
2 changes: 1 addition & 1 deletion distrlock/db_lock_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/acronis/go-appkit/log/logtest"
"github.com/go-sql-driver/mysql"
"github.com/google/uuid"
_ "github.com/jackc/pgx/v4/stdlib"
_ "github.com/jackc/pgx/v5/stdlib"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

Expand Down
33 changes: 16 additions & 17 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,19 @@ go 1.20

require (
github.com/DATA-DOG/go-sqlmock v1.5.2
github.com/acronis/go-appkit v1.3.0
github.com/acronis/go-appkit v1.5.0
github.com/cenkalti/backoff/v4 v4.3.0
github.com/denisenkom/go-mssqldb v0.12.3
github.com/doug-martin/goqu/v9 v9.19.0
github.com/go-sql-driver/mysql v1.8.1
github.com/gocraft/dbr/v2 v2.7.6
github.com/google/uuid v1.6.0
github.com/jackc/pgconn v1.14.3
github.com/jackc/pgx/v4 v4.18.3
github.com/jackc/pgx/v5 v5.6.0
github.com/lib/pq v1.10.9
github.com/mattn/go-sqlite3 v1.14.22
github.com/prometheus/client_golang v1.19.1
github.com/mattn/go-sqlite3 v1.14.24
github.com/prometheus/client_golang v1.20.5
github.com/rubenv/sql-migrate v1.0.0
github.com/stretchr/testify v1.9.0
github.com/stretchr/testify v1.10.0
github.com/testcontainers/testcontainers-go v0.33.0
github.com/testcontainers/testcontainers-go/modules/mariadb v0.33.0
github.com/testcontainers/testcontainers-go/modules/postgres v0.33.0
Expand All @@ -31,11 +30,12 @@ require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/RussellLuo/slidingwindow v0.0.0-20200528002341-535bb99d338b // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/cloudflare/ahocorasick v0.0.0-20240916140611-054963ec9396 // indirect
github.com/containerd/containerd v1.7.18 // indirect
github.com/containerd/log v0.1.0 // indirect
github.com/containerd/platforms v0.2.1 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/cpuguy83/dockercfg v0.3.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/distribution/reference v0.6.0 // indirect
github.com/docker/docker v27.1.1+incompatible // indirect
Expand All @@ -51,13 +51,10 @@ require (
github.com/golang-sql/sqlexp v0.1.0 // indirect
github.com/hashicorp/golang-lru v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
github.com/jackc/pgio v1.0.0 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgproto3/v2 v2.3.3 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/pgtype v1.14.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/jackc/puddle/v2 v2.2.1 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand All @@ -67,15 +64,16 @@ require (
github.com/moby/sys/user v0.1.0 // indirect
github.com/moby/term v0.5.0 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
github.com/prometheus/client_model v0.5.0 // indirect
github.com/prometheus/common v0.48.0 // indirect
github.com/prometheus/procfs v0.12.0 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.55.0 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
github.com/rs/xid v1.5.0 // indirect
github.com/sagikazarmark/locafero v0.6.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
Expand All @@ -102,9 +100,10 @@ require (
go.uber.org/multierr v1.11.0 // indirect
golang.org/x/crypto v0.24.0 // indirect
golang.org/x/exp v0.0.0-20240808152545-0cdaa3abc0fa // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.24.0 // indirect
golang.org/x/text v0.17.0 // indirect
google.golang.org/protobuf v1.33.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/gorp.v1 v1.7.2 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
Expand Down
Loading

0 comments on commit 46ebb34

Please sign in to comment.