Documentation ¶
Index ¶
- func EachMissingRow(src, dst DB, table *Table, f func([]interface{})) error
- func GetIncompatibleRowCount(db DB, src, dst *Table) (int64, error)
- func GetIncompatibleRowIDs(db DB, src, dst *Table) ([]int, error)
- type Column
- type Config
- type DB
- type Migrator
- type MigratorWatcher
- type Schema
- type StdoutPrinter
- func (s *StdoutPrinter) DidBuildSchema()
- func (s *StdoutPrinter) DidDisableConstraints()
- func (s *StdoutPrinter) DidFailToDisableConstraints(err error)
- func (s *StdoutPrinter) DidFailToMigrateRowWithError(tableName string, err error)
- func (s *StdoutPrinter) DidMigrateRow(tableName string)
- func (s *StdoutPrinter) EnableConstraintsDidFailWithError(err error)
- func (s *StdoutPrinter) EnableConstraintsDidFinish()
- func (s *StdoutPrinter) TableMigrationDidFinish(tableName string, recordsInserted int64)
- func (s *StdoutPrinter) TableMigrationDidStart(tableName string)
- func (s *StdoutPrinter) TableVerificationDidFinish(tableName string, missingRows int64, missingIDs []string)
- func (s *StdoutPrinter) TableVerificationDidFinishWithError(tableName string, err error)
- func (s *StdoutPrinter) TableVerificationDidStart(tableName string)
- func (s *StdoutPrinter) TruncateTableDidFinish(tableName string)
- func (s *StdoutPrinter) WillBuildSchema()
- func (s *StdoutPrinter) WillDisableConstraints()
- func (s *StdoutPrinter) WillEnableConstraints()
- func (s *StdoutPrinter) WillTruncateTable(tableName string)
- type Table
- type ValidationResult
- type Validator
- type Verifier
- type VerifierWatcher
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EachMissingRow ¶
Types ¶
type Column ¶
func GetIncompatibleColumns ¶
func (*Column) Compatible ¶
func (*Column) Incompatible ¶
type Config ¶
type Config struct { MySQL struct { Database string `yaml:"database"` Username string `yaml:"username"` Password string `yaml:"password"` Host string `yaml:"host"` Port int `yaml:"port"` } `yaml:"mysql"` PostgreSQL struct { Database string `yaml:"database"` Username string `yaml:"username"` Password string `yaml:"password"` Host string `yaml:"host"` Port int `yaml:"port"` SSLMode string `yaml:"ssl_mode"` } `yaml:"postgresql"` }
type DB ¶
type DB interface { Open() error Close() error GetSchemaRows() (*sql.Rows, error) DisableConstraints() error EnableConstraints() error ColumnNameForSelect(columnName string) string DB() *sql.DB }
func NewMySQLDB ¶
type Migrator ¶
type Migrator interface {
Migrate() error
}
func NewMigrator ¶
func NewMigrator(src, dst DB, truncateFirst bool, watcher MigratorWatcher) Migrator
type MigratorWatcher ¶
type MigratorWatcher interface { WillBuildSchema() DidBuildSchema() WillDisableConstraints() DidDisableConstraints() WillEnableConstraints() EnableConstraintsDidFinish() EnableConstraintsDidFailWithError(err error) WillTruncateTable(tableName string) TruncateTableDidFinish(tableName string) TableMigrationDidStart(tableName string) TableMigrationDidFinish(tableName string, recordsInserted int64) DidMigrateRow(tableName string) DidFailToMigrateRowWithError(tableName string, err error) }
type Schema ¶
func BuildSchema ¶
type StdoutPrinter ¶
type StdoutPrinter struct{}
func NewStdoutPrinter ¶
func NewStdoutPrinter() *StdoutPrinter
func (*StdoutPrinter) DidBuildSchema ¶
func (s *StdoutPrinter) DidBuildSchema()
func (*StdoutPrinter) DidDisableConstraints ¶
func (s *StdoutPrinter) DidDisableConstraints()
func (*StdoutPrinter) DidFailToDisableConstraints ¶
func (s *StdoutPrinter) DidFailToDisableConstraints(err error)
func (*StdoutPrinter) DidFailToMigrateRowWithError ¶
func (s *StdoutPrinter) DidFailToMigrateRowWithError(tableName string, err error)
func (*StdoutPrinter) DidMigrateRow ¶
func (s *StdoutPrinter) DidMigrateRow(tableName string)
func (*StdoutPrinter) EnableConstraintsDidFailWithError ¶
func (s *StdoutPrinter) EnableConstraintsDidFailWithError(err error)
func (*StdoutPrinter) EnableConstraintsDidFinish ¶
func (s *StdoutPrinter) EnableConstraintsDidFinish()
func (*StdoutPrinter) TableMigrationDidFinish ¶
func (s *StdoutPrinter) TableMigrationDidFinish(tableName string, recordsInserted int64)
func (*StdoutPrinter) TableMigrationDidStart ¶
func (s *StdoutPrinter) TableMigrationDidStart(tableName string)
func (*StdoutPrinter) TableVerificationDidFinish ¶
func (s *StdoutPrinter) TableVerificationDidFinish(tableName string, missingRows int64, missingIDs []string)
func (*StdoutPrinter) TableVerificationDidFinishWithError ¶
func (s *StdoutPrinter) TableVerificationDidFinishWithError(tableName string, err error)
func (*StdoutPrinter) TableVerificationDidStart ¶
func (s *StdoutPrinter) TableVerificationDidStart(tableName string)
func (*StdoutPrinter) TruncateTableDidFinish ¶
func (s *StdoutPrinter) TruncateTableDidFinish(tableName string)
func (*StdoutPrinter) WillBuildSchema ¶
func (s *StdoutPrinter) WillBuildSchema()
func (*StdoutPrinter) WillDisableConstraints ¶
func (s *StdoutPrinter) WillDisableConstraints()
func (*StdoutPrinter) WillEnableConstraints ¶
func (s *StdoutPrinter) WillEnableConstraints()
func (*StdoutPrinter) WillTruncateTable ¶
func (s *StdoutPrinter) WillTruncateTable(tableName string)
type ValidationResult ¶
type Validator ¶
type Validator interface {
Validate() ([]ValidationResult, error)
}
func NewValidator ¶
type Verifier ¶
type Verifier interface {
Verify() error
}
func NewVerifier ¶
func NewVerifier(src, dst DB, watcher VerifierWatcher) Verifier
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
This file was generated by counterfeiter This file was generated by counterfeiter
|
This file was generated by counterfeiter This file was generated by counterfeiter |
Click to show internal directories.
Click to hide internal directories.