Versions in this module Expand all Collapse all v1 v1.0.1 Dec 16, 2022 v1.0.0 Dec 16, 2022 Changes in this version + var DefaultBufferSize = uint(100000) + var DefaultLockTimeout = 15 * time.Second + var DefaultPrefetchMigrations = uint(10) + var ErrInvalidVersion = errors.New("version must be >= -1") + var ErrLockTimeout = errors.New("timeout: can't acquire database lock") + var ErrLocked = errors.New("database locked") + var ErrNilVersion = errors.New("no migration") + var ErrNoChange = errors.New("no change") + func FilterCustomQuery(u *nurl.URL) *nurl.URL + type ErrDirty struct + Version int + func (e ErrDirty) Error() string + type ErrShortLimit struct + Short uint + func (e ErrShortLimit) Error() string + type Logger interface + Printf func(format string, v ...interface{}) + Verbose func() bool + type Migrate struct + GracefulStop chan bool + LockTimeout time.Duration + Log Logger + PrefetchMigrations uint + func New(sourceURL, databaseURL string) (*Migrate, error) + func NewWithDatabaseInstance(sourceURL string, databaseName string, databaseInstance database.Driver) (*Migrate, error) + func NewWithInstance(sourceName string, sourceInstance source.Driver, databaseName string, ...) (*Migrate, error) + func NewWithSourceInstance(sourceName string, sourceInstance source.Driver, databaseURL string) (*Migrate, error) + func (m *Migrate) Close() (source error, database error) + func (m *Migrate) Down() error + func (m *Migrate) Drop() error + func (m *Migrate) Force(version int) error + func (m *Migrate) Migrate(version uint) error + func (m *Migrate) Run(migration ...*Migration) error + func (m *Migrate) Steps(n int) error + func (m *Migrate) Up() error + func (m *Migrate) Version() (version uint, dirty bool, err error) + type Migration struct + Body io.ReadCloser + BufferSize uint + BufferedBody io.Reader + BytesRead int64 + FinishedBuffering time.Time + FinishedReading time.Time + Identifier string + Scheduled time.Time + StartedBuffering time.Time + TargetVersion int + Version uint + func NewMigration(body io.ReadCloser, identifier string, version uint, targetVersion int) (*Migration, error) + func (m *Migration) Buffer() error + func (m *Migration) LogString() string + func (m *Migration) String() string + type MultiError struct + Errs []error + func NewMultiError(errs ...error) MultiError + func (m MultiError) Error() string