Documentation ¶
Index ¶
- func ApplyMigrations(db *sql.DB, base string, corpora ...string) (err error)
- func InitFilename(filename, base string, corpora ...string) (db *sql.DB, err error)
- func New(t *testing.T, shouldCleanup *bool, base string, corpora ...string) (name string, cleanup func(), db *sql.DB)
- func NewFilename(t *testing.T, cleanup *bool) (string, func())
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyMigrations ¶
ApplyMigrations will apply the migrations to the given db. If corpus does not start with a "/" then base will be prepended to it. Otherwise the corpus will be used as is.
func InitFilename ¶
InitFilename will init the sqlite3 database with the corpus migrations applied to it. If corpus does not start with a "/" then base will be prepended to it. Otherwise the corpus will be used as is.
func New ¶
func New(t *testing.T, shouldCleanup *bool, base string, corpora ...string) (name string, cleanup func(), db *sql.DB)
New will create a new database with the corpus migrations applied to it. If corpus does not start with a "/" then base will be prepended to it. Otherwise the corpus will be used as is.
func NewFilename ¶
NewFilename will generate a new file that can be used for the database, and provide a cleanup function to remove the file after it's no longer needed. cleanup can be passed; which will tell the cleanup functions weather or not to delete the file. This is handy for debugging. Where you want a failed to test to print out the file name, so that the developer can inspect it later.
Types ¶
This section is empty.