Documentation
¶
Overview ¶
Package testdb gives a test its own empty Postgres database with pcom's migrations applied. The database is dropped when the test ends.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func New ¶
New returns a fresh, fully migrated database. Use TestDB.DB (*sqlx.DB) as the executor and TestDB.URL to hand the database to a subprocess.
gogo connects with lib/pq; New reconnects through pgx, the driver the server uses, so tests run on the production driver. gogo's cleanup closes whatever TestDB.DB holds before it drops the database, so the pgx connection is closed first.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.