Upgrade to pgx v5

This commit is contained in:
Jesse de Wit
2023-10-23 14:42:28 +02:00
parent 3cf4b714a9
commit 8a7133f116
11 changed files with 29 additions and 28 deletions

View File

@@ -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)
}

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -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 {

View File

@@ -5,7 +5,7 @@ import (
"encoding/hex"
"time"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/jackc/pgx/v5/pgxpool"
)
type NotificationsStore struct {

View File

@@ -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 {