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

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