SDK v3 #8
@ -15,6 +15,7 @@ import (
|
||||
"gorm.io/gorm"
|
||||
"gorm.io/gorm/logger"
|
||||
|
||||
_ "github.com/lib/pq"
|
||||
"github.com/testcontainers/testcontainers-go"
|
||||
"github.com/testcontainers/testcontainers-go/wait"
|
||||
)
|
||||
@ -28,8 +29,7 @@ const (
|
||||
|
||||
func StartPostgresContainer(ctx context.Context) (*postgrescontainer.PostgresContainer, *gorm.DB, error) {
|
||||
|
||||
pgContainer, err := postgrescontainer.RunContainer(ctx,
|
||||
testcontainers.WithImage("postgres:alpine"),
|
||||
pgContainer, err := postgrescontainer.Run(ctx, "postgres:alpine",
|
||||
postgrescontainer.WithDatabase(databaseName),
|
||||
postgrescontainer.WithUsername(databaseUser),
|
||||
postgrescontainer.WithPassword(databasePassword),
|
||||
|
Loading…
Reference in New Issue
Block a user