Documentation
¶
Overview ¶
Package testpg provides isolated PostgreSQL schemas for integration tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Schema ¶
Schema is an isolated PostgreSQL schema whose pool uses it as search_path.
func New ¶
New creates an isolated schema. If FUNQ_TEST_DATABASE_URL is set, it uses that database. Otherwise, it programmatically spins up a PostgreSQL container using testcontainers-go and creates the isolated schema within it.
To prevent accidental destructive setup on host databases, the database name must contain "funq_test". A dedicated test database with another name may be explicitly acknowledged by setting FUNQ_TEST_DATABASE_ISOLATED=1.
Click to show internal directories.
Click to hide internal directories.