Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateFunc ¶
CreateFunc describes a function to create a fresh database for the test
func NewPostgresFactory ¶
NewPostgresFactory creates a new db creation func to create databases for tests. The final callback may be added to apply operations on the database after its creation.
func SetupPostgres ¶
func SetupPostgres(ctx context.Context, image string, callback func(*sql.DB)) (CreateFunc, func() error, error)
SetupPostgres will spin upo a postgres container using testcontainers and return a CreateFunc that can be used in tests to create fresh databases in the postgres container. The second argument is the cancellation function.
Click to show internal directories.
Click to hide internal directories.