Documentation
¶
Index ¶
Constants ¶
View Source
const DEFAULT_TABLE_NAME = "dsync_migration_info"
Variables ¶
This section is empty.
Functions ¶
func ValidateConfig ¶
Types ¶
type Config ¶
func (Config) TableNameOrDefault ¶
type DataSource ¶
type DataSource interface { // GetMigrationInfo Returns table name and other information GetMigrationInfo() (*MigrationInfo, error) // GetChangeSetFileSystem GetChangeSetFileSystem returns the source file system where migration changeset files are stored GetChangeSetFileSystem() (fs.FS, error) // GetPath GetPath Returns the base path within the file system where to GetPath() string // BeginTransaction BeginTransaction Start transaction BeginTransaction() error // SetTransactionSuccessful SetTransactionSuccessful notify the data source whether to commit or rollback when EndTransaction is called SetTransactionSuccessful(s bool) // ApplyMigration ApplyMigration Applies the given migration ApplyMigration(migration *Migration) error // EndTransaction EndTransaction Commit or rollback the active transaction EndTransaction() // Return the underlying database handle Handle() *sql.DB }
type Migration ¶
type Migration struct { Id uint32 Name string File string Version int64 CreatedAt time.Time Checksum int64 Success bool }
func ParseMigration ¶
ParseMigration Parse migration information from file name
type MigrationError ¶
func (MigrationError) Error ¶
func (e MigrationError) Error() string
type MigrationInfo ¶
Click to show internal directories.
Click to hide internal directories.