Documentation
¶
Overview ¶
Package pgtest starts an ephemeral Postgres for tests via Testcontainers. Import only from _test.go files so production binaries do not link the Docker SDK.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseName ¶
DatabaseName turns tb.Name() into a Postgres identifier (≤63 chars).
Types ¶
type Container ¶
type Container struct {
// contains filtered or unexported fields
}
Container is a running Postgres (Testcontainers or DATABASE_* from the environment).
func Start ¶
Start is StartOrEnv: reuse DATABASE_* when DATABASE_HOST is set (CI sidecar), otherwise launch postgres:17 via Testcontainers.
func StartOrEnv ¶
StartOrEnv uses DATABASE_* when DATABASE_HOST is set; otherwise starts a container.
Click to show internal directories.
Click to hide internal directories.