Documentation
¶
Overview ¶
Package pgtest provides a shared test helper for spinning up a PostgreSQL container with migrations applied.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SetupResult ¶
type SetupResult struct {
Pool *pgxpool.Pool
ConnStr string
Container testcontainers.Container
}
SetupResult holds the resources from setting up a test database.
func Setup ¶
func Setup(t *testing.T) *SetupResult
Setup creates a PostgreSQL container, runs migrations, and returns a connection pool. The container is automatically terminated when the test completes.
Click to show internal directories.
Click to hide internal directories.