Documentation
¶
Index ¶
- func ChangeCwd(t *testing.T, path string)
- func CreateConfigFile(t *testing.T, cfg *configloader.Config, filePath string)
- func CreateTempFile(t *testing.T, filePath string) *os.File
- func DropTable(t *testing.T, db storage.DB, tableName string)
- func NewTestConnectionConfig() configloader.ConnectionConfig
- func NewTestDB(t *testing.T) storage.DB
- func UnsetEnv(t *testing.T, key string)
- type ApplyReturnValue
- type ApplyWithTxReturnValue
- type CreateReturnValue
- type IsAppliedReturnValue
- type ListReturnValue
- type MockDB
- func (m *MockDB) Close() error
- func (m *MockDB) Exec(query string, args ...interface{}) (sql.Result, error)
- func (m *MockDB) Query(query string, args ...interface{}) (*sql.Rows, error)
- func (m *MockDB) QueryRow(query string, args ...interface{}) *sql.Row
- func (m *MockDB) TableExists(tableName string) (bool, error)
- func (m *MockDB) Tx(fn storage.TxFunc) error
- type MockMigrationDBRepo
- func (repo *MockMigrationDBRepo) Apply(upgradeScript string, migration *models.Migration) error
- func (repo *MockMigrationDBRepo) ApplyWithTx(upgradeScript string, migration *models.Migration) error
- func (repo *MockMigrationDBRepo) IsApplied(version string) (bool, error)
- func (repo *MockMigrationDBRepo) List() (map[string]*models.Migration, error)
- func (repo *MockMigrationDBRepo) Revert(downgradeScript string, migration *models.Migration) error
- func (repo *MockMigrationDBRepo) RevertWithTx(downgradeScript string, migration *models.Migration) error
- type MockMigrationFsRepo
- func (repo *MockMigrationFsRepo) Create(migration *models.Migration) error
- func (repo *MockMigrationFsRepo) List() (map[string]*models.Migration, error)
- func (repo *MockMigrationFsRepo) ReadDowngradeScript(migration *models.Migration) (sqlparse.MigrationScript, error)
- func (repo *MockMigrationFsRepo) ReadUpgradeScript(migration *models.Migration) (sqlparse.MigrationScript, error)
- type NullOutputter
- type ReadDowngradeScriptReturnValue
- type ReadUpgradeScriptReturnValue
- type RevertReturnValue
- type RevertWithTxReturnValue
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateConfigFile ¶
func CreateConfigFile(t *testing.T, cfg *configloader.Config, filePath string)
func NewTestConnectionConfig ¶
func NewTestConnectionConfig() configloader.ConnectionConfig
Types ¶
type ApplyReturnValue ¶ added in v0.3.0
type ApplyReturnValue struct {
Err error
}
type ApplyWithTxReturnValue ¶ added in v0.3.0
type ApplyWithTxReturnValue = ApplyReturnValue
type CreateReturnValue ¶ added in v0.3.0
type CreateReturnValue struct {
Err error
}
type IsAppliedReturnValue ¶ added in v0.3.0
type ListReturnValue ¶ added in v0.3.0
type MockDB ¶ added in v0.10.0
type MockDB struct { ExecFunc func(query string, args ...interface{}) (sql.Result, error) QueryFunc func(query string, args ...interface{}) (*sql.Rows, error) QueryRowFunc func(query string, args ...interface{}) *sql.Row TxFunc func(fn storage.TxFunc) error CloseFunc func() error TableExistsFunc func(tableName string) (bool, error) }
func (*MockDB) TableExists ¶ added in v0.10.0
type MockMigrationDBRepo ¶ added in v0.3.0
type MockMigrationDBRepo struct { ListReturnValue ListReturnValue ListCallCount int IsAppliedReturnValue IsAppliedReturnValue IsAppliedCallCount int ApplyReturnValue ApplyReturnValue ApplyCallCount int ApplyWithTxReturnValue ApplyWithTxReturnValue ApplyWithTxCallCount int RevertReturnValue RevertReturnValue RevertCallCount int RevertWithTxReturnValue RevertWithTxReturnValue RevertWithTxCallCount int }
func (*MockMigrationDBRepo) Apply ¶ added in v0.3.0
func (repo *MockMigrationDBRepo) Apply( upgradeScript string, migration *models.Migration, ) error
func (*MockMigrationDBRepo) ApplyWithTx ¶ added in v0.3.0
func (repo *MockMigrationDBRepo) ApplyWithTx( upgradeScript string, migration *models.Migration, ) error
func (*MockMigrationDBRepo) IsApplied ¶ added in v0.3.0
func (repo *MockMigrationDBRepo) IsApplied(version string) (bool, error)
func (*MockMigrationDBRepo) List ¶ added in v0.3.0
func (repo *MockMigrationDBRepo) List() (map[string]*models.Migration, error)
func (*MockMigrationDBRepo) Revert ¶ added in v0.3.0
func (repo *MockMigrationDBRepo) Revert( downgradeScript string, migration *models.Migration, ) error
func (*MockMigrationDBRepo) RevertWithTx ¶ added in v0.3.0
func (repo *MockMigrationDBRepo) RevertWithTx( downgradeScript string, migration *models.Migration, ) error
type MockMigrationFsRepo ¶ added in v0.3.0
type MockMigrationFsRepo struct { CreateReturnValue CreateReturnValue CreateCallCount int ListReturnValue ListReturnValue ListCallCount int ReadUpgradeScriptReturnValue ReadUpgradeScriptReturnValue ReadUpgradeScriptCallCount int ReadDowngradeScriptReturnValue ReadDowngradeScriptReturnValue ReadDowngradeScriptCallCount int }
func (*MockMigrationFsRepo) Create ¶ added in v0.3.0
func (repo *MockMigrationFsRepo) Create(migration *models.Migration) error
func (*MockMigrationFsRepo) List ¶ added in v0.3.0
func (repo *MockMigrationFsRepo) List() (map[string]*models.Migration, error)
func (*MockMigrationFsRepo) ReadDowngradeScript ¶ added in v0.3.0
func (repo *MockMigrationFsRepo) ReadDowngradeScript( migration *models.Migration, ) (sqlparse.MigrationScript, error)
func (*MockMigrationFsRepo) ReadUpgradeScript ¶ added in v0.3.0
func (repo *MockMigrationFsRepo) ReadUpgradeScript( migration *models.Migration, ) (sqlparse.MigrationScript, error)
type NullOutputter ¶ added in v0.3.0
func (NullOutputter) Error ¶ added in v0.3.0
func (o NullOutputter) Error(err error) error
func (NullOutputter) Output ¶ added in v0.3.0
func (o NullOutputter) Output(message string) error
type ReadDowngradeScriptReturnValue ¶ added in v0.3.0
type ReadDowngradeScriptReturnValue = ReadUpgradeScriptReturnValue
type ReadUpgradeScriptReturnValue ¶ added in v0.3.0
type ReadUpgradeScriptReturnValue struct { Script sqlparse.MigrationScript Err error }
type RevertReturnValue ¶ added in v0.3.0
type RevertReturnValue = ApplyReturnValue
type RevertWithTxReturnValue ¶ added in v0.3.0
type RevertWithTxReturnValue = ApplyReturnValue
Click to show internal directories.
Click to hide internal directories.