Documentation
¶
Overview ¶
Package pgtest hands each test binary its own freshly created postgres database and connection URL, plus FreshPool for a reset, migrated, connected pool on top. The server is the shared container from PGTEST_URL when set, else a per-binary testcontainer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FreshPool ¶
FreshPool returns a connected pool against this binary's database, reset to a clean schema and migrated from fsys/dir. Each service supplies its own embedded migrations.
func URL ¶
URL returns this binary's database URL: drop-and-recreated on first call, memoized after. Call it directly from the package under test - the database name derives from the caller's directory, keeping binaries under `go test -p 2` on separate databases. Prefer FreshPool unless you need a reset database without a forced migrate.
Types ¶
This section is empty.