testsqlx

package
v0.0.0-...-8366d43 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2018 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TestMySQLHost     = "TEST_MYSQL_HOST"
	TestMySQLPort     = "TEST_MYSQL_PORT"
	TestMySQLDatabase = "TEST_MYSQL_DATABASE"
	TestMySQLUsername = "TEST_MYSQL_USERNAME"
	TestMySQLPassword = "TEST_MYSQL_PASSWORD"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type TestDB

type TestDB interface {
	Create(migrations ...sqlx.Migration) error
	Drop() error
	Connect() (*sqlx.DB, error)
	Truncate(truncateStmts ...string) error
}

type TestDBOption

type TestDBOption func(*options)

func DBDatabase

func DBDatabase(database string) TestDBOption

func DBHost

func DBHost(host string) TestDBOption

func DBPassword

func DBPassword(password string) TestDBOption

func DBPort

func DBPort(port int) TestDBOption

func DBUser

func DBUser(user string) TestDBOption

type TestMySQLDB

type TestMySQLDB struct {
	// contains filtered or unexported fields
}

func NewTestMySQLDB

func NewTestMySQLDB(opts ...TestDBOption) *TestMySQLDB

func (*TestMySQLDB) Connect

func (db *TestMySQLDB) Connect() (*sqlx.DB, error)

func (*TestMySQLDB) Create

func (db *TestMySQLDB) Create(migrations ...sqlx.Migration) error

func (*TestMySQLDB) Drop

func (db *TestMySQLDB) Drop() error

func (*TestMySQLDB) Truncate

func (db *TestMySQLDB) Truncate(truncateStmts ...string) error

Jump to

Keyboard shortcuts

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