Discover Packages
github.com/gobackio/goback
testing
testpg
package
Version:
v1.64.1
Opens a new window with list of versions in this module.
Published: Oct 13, 2026
License: Apache-2.0
Opens a new window with license information.
Imports: 14
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package testpg gives tests a throwaway Postgres database.
Container starts a Postgres server of its own, outside any test, and
returns the DSN of its empty postgres database and a func that stops it.
Start returns the superuser DSN of a new, empty database of its own,
dropped when the test ends. Every test of a binary shares one Postgres
container. The test is skipped in short mode, and without Docker unless
CI is set.
WithApp is Start, and the DSN of a role that may only create schemas in
that database, as the servers' own role may.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.