Documentation ¶
Overview ¶
Package dbtest is a package to ease the pain of developing test code that works against external databases. It provides helper functions to provision temporary databases and load them with test data.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DB ¶
DB represents an ephemeral database that can be starts blank and can be used to run tests against.
func Mysql ¶
Mysql provisions a new, blank database with a random name on the localhost of the running process. It assumes that you have mysql running and that the root user has access with no password. It panics on the event of a failure.
func Postgres ¶
Postgres provisions a new, blank database with a random name on the localhost of the running process. It assumes that you have postgres running on the default port, have the command line postgres tools installed, and that the current user has access to the server. It panics on the event of a failure.