Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *sqlx.DB
DB connection for tests
Functions ¶
func GetDatabaseNameFromDSN ¶
GetDatabaseNameFromDSN gests the database name from the dsn
Types ¶
type DatabaseSetter ¶
type DatabaseSetter interface { ConnectDatabase() (*sqlx.DB, error) CreateDatabase() error DropDatabase() error }
DatabaseSetter defines an interface for database configurators
func GetDatabaseSetter ¶
func GetDatabaseSetter(c sqlxdb.Config) (DatabaseSetter, error)
GetDatabaseSetter gets a database setter for the driver on c (sqlxdb.Config)
type Postgres ¶
type Postgres struct {
TestDB
}
Postgres represents a test database for postgres
func NewPostgres ¶
NewPostgres creates a Postgres instance
func (Postgres) ConnectDatabase ¶
ConnectDatabase - Implements DatabaseSetter
func (Postgres) CreateDatabase ¶
CreateDatabase - Implements DatabaseSetter
func (Postgres) DropDatabase ¶
DropDatabase - Implements DatabaseSetter
Click to show internal directories.
Click to hide internal directories.