Expand description
Destructive helpers for creating isolated PostgreSQL test databases.
These APIs create, terminate connections to, and drop databases. They are intended only for test harnesses whose prefix is exclusively owned by the caller.
Structs§
- Test
Database Guard - Owns a test database and removes it promptly when dropped.
Constants§
- DEFAULT_
STALE_ TEST_ DATABASE_ AGE - Default minimum age of a disconnected test database before it is reaped.
Functions§
- create_
test_ database - Creates an isolated database and a guard that drops it on normal exit.
- reap_
stale_ test_ databases - Drops disconnected databases in the generated naming format that are at
least
max_ageold, returning only names this call actually dropped.