diff --git a/go.mod b/go.mod index eb6e972..e8aeace 100644 --- a/go.mod +++ b/go.mod @@ -16,7 +16,7 @@ require ( github.com/golang/protobuf v1.5.2 github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 github.com/jackc/pgtype v1.8.1 - github.com/jackc/pgx/v4 v4.13.0 + github.com/jackc/pgx/v5 v5.4.3 github.com/lightningnetwork/lightning-onion v1.2.1-0.20221202012345-ca23184850a1 github.com/lightningnetwork/lnd v0.16.2-beta github.com/lightningnetwork/lnd/tlv v1.1.0 @@ -37,6 +37,14 @@ require ( github.com/ethereum/go-ethereum v1.12.1 // indirect github.com/golang-jwt/jwt/v4 v4.4.2 // indirect github.com/google/uuid v1.3.0 // indirect + github.com/jackc/chunkreader/v2 v2.0.1 // indirect + github.com/jackc/pgconn v1.10.0 // indirect + github.com/jackc/pgio v1.0.0 // indirect + github.com/jackc/pgpassfile v1.0.0 // indirect + github.com/jackc/pgproto3/v2 v2.1.1 // indirect + github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect + github.com/jackc/pgx/v4 v4.13.0 // indirect + github.com/jackc/puddle/v2 v2.2.1 // indirect github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect github.com/lightninglabs/neutrino/cache v1.1.1 // indirect github.com/mailru/easyjson v0.7.7 // indirect @@ -104,13 +112,6 @@ require ( github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0 // indirect github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect github.com/grpc-ecosystem/grpc-gateway/v2 v2.5.0 // indirect - github.com/jackc/chunkreader/v2 v2.0.1 // indirect - github.com/jackc/pgconn v1.10.0 // indirect - github.com/jackc/pgio v1.0.0 // indirect - github.com/jackc/pgpassfile v1.0.0 // indirect - github.com/jackc/pgproto3/v2 v2.1.1 // indirect - github.com/jackc/pgservicefile v0.0.0-20200714003250-2b9c44734f2b // indirect - github.com/jackc/puddle v1.1.3 // indirect github.com/jessevdk/go-flags v1.4.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jonboulle/clockwork v0.2.2 // indirect diff --git a/itest/lspd_node.go b/itest/lspd_node.go index 16d2a4c..fa6beab 100644 --- a/itest/lspd_node.go +++ b/itest/lspd_node.go @@ -21,7 +21,7 @@ import ( "github.com/decred/dcrd/dcrec/secp256k1/v4" ecies "github.com/ecies/go/v2" "github.com/golang/protobuf/proto" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5/pgxpool" "google.golang.org/grpc/metadata" ) @@ -193,7 +193,7 @@ func (l *lspBase) Initialize() error { return err } - pgxPool, err := pgxpool.Connect(l.harness.Ctx, l.postgresBackend.ConnectionString()) + pgxPool, err := pgxpool.New(l.harness.Ctx, l.postgresBackend.ConnectionString()) if err != nil { lntest.PerformCleanup(cleanups) return fmt.Errorf("failed to connect to postgres: %w", err) @@ -301,7 +301,7 @@ type FeeParamSetting struct { } func SetFeeParams(l LspNode, settings []*FeeParamSetting) error { - pgxPool, err := pgxpool.Connect(l.Harness().Ctx, l.PostgresBackend().ConnectionString()) + pgxPool, err := pgxpool.New(l.Harness().Ctx, l.PostgresBackend().ConnectionString()) if err != nil { return fmt.Errorf("failed to connect to postgres: %w", err) } diff --git a/itest/lsps2_buy_test.go b/itest/lsps2_buy_test.go index 15c62c6..eaf9841 100644 --- a/itest/lsps2_buy_test.go +++ b/itest/lsps2_buy_test.go @@ -9,7 +9,7 @@ import ( "github.com/breez/lntest" "github.com/breez/lspd/lightning" "github.com/breez/lspd/lsps0" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" ) @@ -89,7 +89,7 @@ func testLsps2Buy(p *testParams) { err = json.Unmarshal(buyResp.Data, b) lntest.CheckError(p.t, err) - pgxPool, err := pgxpool.Connect(p.h.Ctx, p.lsp.PostgresBackend().ConnectionString()) + pgxPool, err := pgxpool.New(p.h.Ctx, p.lsp.PostgresBackend().ConnectionString()) if err != nil { p.h.T.Fatalf("Failed to connect to postgres backend: %v", err) } diff --git a/itest/postgres.go b/itest/postgres.go index 5cb5047..d0092cb 100644 --- a/itest/postgres.go +++ b/itest/postgres.go @@ -18,7 +18,7 @@ import ( "github.com/docker/docker/api/types/container" "github.com/docker/docker/client" "github.com/docker/go-connections/nat" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5/pgxpool" ) type PostgresContainer struct { @@ -91,7 +91,7 @@ HealthCheck: return fmt.Errorf("container '%s' unhealthy", c.id) case "healthy": for { - pgxPool, err := pgxpool.Connect(ctx, c.ConnectionString()) + pgxPool, err := pgxpool.New(ctx, c.ConnectionString()) if err == nil { pgxPool.Close() break HealthCheck @@ -246,7 +246,7 @@ func (c *PostgresContainer) RunMigrations(ctx context.Context, migrationDir stri sort.Strings(filenames) - pgxPool, err := pgxpool.Connect(ctx, c.ConnectionString()) + pgxPool, err := pgxpool.New(ctx, c.ConnectionString()) if err != nil { return fmt.Errorf("failed to connect to postgres: %w", err) } diff --git a/itest/tag_test.go b/itest/tag_test.go index 65af104..dc9f4ff 100644 --- a/itest/tag_test.go +++ b/itest/tag_test.go @@ -5,7 +5,7 @@ import ( "github.com/breez/lntest" lspd "github.com/breez/lspd/rpc" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5/pgxpool" "github.com/stretchr/testify/assert" ) @@ -25,7 +25,7 @@ func registerPaymentWithTag(p *testParams) { Tag: expected, }, false) - pgxPool, err := pgxpool.Connect(p.h.Ctx, p.lsp.PostgresBackend().ConnectionString()) + pgxPool, err := pgxpool.New(p.h.Ctx, p.lsp.PostgresBackend().ConnectionString()) if err != nil { p.h.T.Fatalf("Failed to connect to postgres backend: %v", err) } diff --git a/postgresql/connect.go b/postgresql/connect.go index b14942f..92f885a 100644 --- a/postgresql/connect.go +++ b/postgresql/connect.go @@ -4,12 +4,12 @@ import ( "context" "fmt" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5/pgxpool" ) func PgConnect(databaseUrl string) (*pgxpool.Pool, error) { var err error - pgxPool, err := pgxpool.Connect(context.Background(), databaseUrl) + pgxPool, err := pgxpool.New(context.Background(), databaseUrl) if err != nil { return nil, fmt.Errorf("pgxpool.Connect(%v): %w", databaseUrl, err) } diff --git a/postgresql/forwarding_event_store.go b/postgresql/forwarding_event_store.go index 42cda1c..ce0fbff 100644 --- a/postgresql/forwarding_event_store.go +++ b/postgresql/forwarding_event_store.go @@ -6,8 +6,8 @@ import ( "log" "github.com/breez/lspd/lnd" - "github.com/jackc/pgx/v4" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgxpool" ) type ForwardingEventStore struct { diff --git a/postgresql/intercept_store.go b/postgresql/intercept_store.go index 2bb7228..46b5e68 100644 --- a/postgresql/intercept_store.go +++ b/postgresql/intercept_store.go @@ -11,8 +11,8 @@ import ( "github.com/breez/lspd/lightning" "github.com/btcsuite/btcd/wire" "github.com/jackc/pgtype" - "github.com/jackc/pgx/v4" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgxpool" ) type PostgresInterceptStore struct { diff --git a/postgresql/lsps2_store.go b/postgresql/lsps2_store.go index f107d9c..093ac7e 100644 --- a/postgresql/lsps2_store.go +++ b/postgresql/lsps2_store.go @@ -12,8 +12,8 @@ import ( "github.com/breez/lspd/lsps0" "github.com/breez/lspd/lsps2" "github.com/btcsuite/btcd/wire" - "github.com/jackc/pgx/v4" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5" + "github.com/jackc/pgx/v5/pgxpool" ) type Lsps2Store struct { diff --git a/postgresql/notifications_store.go b/postgresql/notifications_store.go index b0675a8..6b76577 100644 --- a/postgresql/notifications_store.go +++ b/postgresql/notifications_store.go @@ -5,7 +5,7 @@ import ( "encoding/hex" "time" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5/pgxpool" ) type NotificationsStore struct { diff --git a/postgresql/opening_store.go b/postgresql/opening_store.go index 2d9ad27..bfed434 100644 --- a/postgresql/opening_store.go +++ b/postgresql/opening_store.go @@ -7,7 +7,7 @@ import ( "time" "github.com/breez/lspd/common" - "github.com/jackc/pgx/v4/pgxpool" + "github.com/jackc/pgx/v5/pgxpool" ) type extendedParams struct {