bolttest

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangeCwd

func ChangeCwd(t *testing.T, path string)

func CreateConfigFile

func CreateConfigFile(t *testing.T, cfg *configloader.Config, filePath string)

func CreateTempFile

func CreateTempFile(t *testing.T, filePath string) *os.File

func DropTable added in v0.5.0

func DropTable(t *testing.T, db storage.DB, tableName string)

func NewTestConnectionConfig

func NewTestConnectionConfig() configloader.ConnectionConfig

func NewTestDB

func NewTestDB(t *testing.T) storage.DB

func UnsetEnv added in v0.5.0

func UnsetEnv(t *testing.T, key string)

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 IsAppliedReturnValue struct {
	IsApplied bool
	Err       error
}

type ListReturnValue added in v0.3.0

type ListReturnValue struct {
	Migrations map[string]*models.Migration
	Err        error
}

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

type NullOutputter struct {
	OutputLogs []string
	ErrorLogs  []string
	TableLogs  []string
}

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

func (NullOutputter) Table added in v0.3.0

func (o NullOutputter) Table(header []string, rows [][]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

Jump to

Keyboard shortcuts

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