Documentation
¶
Overview ¶
Package dbfixture will setup a and reset a fresh database for each of your tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
Host string
// User is intended as the superuser that is used to bootstrap a database instance for use
User string
// AppUser is intended as a reduced permission user that the application uses to interact with the database
AppUser string
// Password is intended as the password for the superuser that can modify db structure
Password secret.String
// AppPassword is intended as the password for the least-privileged application db user
AppPassword secret.String
}
type Fixture ¶
type Fixture struct {
DBName string
Host string
User string
Password secret.String
DB *sqlx.DB
TX *db.TxManager
Cleanup func(ctx context.Context) error
AdminDB *sqlx.DB
AdminTX *db.TxManager
// contains filtered or unexported fields
}
type SharedFixture ¶
type SharedFixture struct {
// contains filtered or unexported fields
}
func SetupSystem ¶
func SetupSystem(t types.TestingTB, con Connection) *SharedFixture
SetupSystem prepares the running system for use callers should not rely on the fact this currently uses a package global
func (*SharedFixture) Manager ¶
func (s *SharedFixture) Manager() *Manager
Click to show internal directories.
Click to hide internal directories.