test

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FirstMigrationBroken added in v0.4.0

func FirstMigrationBroken(t *testing.T, td Database)

FirstMigrationBroken checks that if the first migration breaks that the correct data is returned and that the migrations table is correct

func Migrate added in v0.4.0

func Migrate(t *testing.T, td Database)

Migrate checks that a migration works

func MigrateAfterPreviouslyCompleted added in v0.4.0

func MigrateAfterPreviouslyCompleted(t *testing.T, td Database)

MigrateAfterPreviouslyCompleted checks that a new migration works and starts off after the previous migration.

func NoMigrationsInPath added in v0.4.0

func NoMigrationsInPath(t *testing.T, td Database)

NoMigrationsInPath checks that no action is taken if there are no migrations to process

func SecondMigrationBroken added in v0.4.0

func SecondMigrationBroken(t *testing.T, td Database)

SecondMigrationBroken checks that if the second migration fails that the correct data is returned and that the migrations table is correct

Types

type Database added in v0.4.0

type Database interface {
	OpenDB() (db *sql.DB, err error)
	GetDialect() redwing.Dialect
	CreateMigrationTableWithData(db *sql.DB) error
	GetLastMigration(db *sql.DB) (int, error)
	CleanupDB(db *sql.DB)
}

Database is an interface that contains helper methods that should be implemented by a struct representing a database under test.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL