migrator

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: BSD-3-Clause Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connection

type Connection interface {
	DSN() string
	Driver() connection.Driver
	Ping() error
	QueryContext(ctx context.Context, query string, args ...any) (sqlex.Rows, error)
	ExecContext(ctx context.Context, query string, args ...any) (sqlex.Result, error)
	Transaction(ctx context.Context, txFn func(ctx context.Context) error) error
	io.Closer
}

type DBService

type DBService struct {
	// contains filtered or unexported fields
}

func New

func New(options *Options) *DBService

func (*DBService) Close added in v1.2.0

func (s *DBService) Close() error

func (*DBService) Create

func (s *DBService) Create() *action.Create

func (*DBService) Downgrade

func (s *DBService) Downgrade() (*action.Downgrade, error)

func (*DBService) History

func (s *DBService) History() (*action.History, error)

func (*DBService) HistoryNew

func (s *DBService) HistoryNew() (*action.HistoryNew, error)

func (*DBService) MigrationService added in v0.4.0

func (s *DBService) MigrationService() (*service.Migration, error)

func (*DBService) Redo

func (s *DBService) Redo() (*action.Redo, error)

func (*DBService) To

func (s *DBService) To() (*action.To, error)

func (*DBService) Upgrade

func (s *DBService) Upgrade() (*action.Upgrade, error)

type FileNameBuilder

type FileNameBuilder interface {
	// Up builds a file name for migration update
	Up(version string, forceSafely bool) (fname string, safely bool)
	// Down builds a file name for migration downgrade
	Down(version string, forceSafely bool) (fname string, safely bool)
}

type Options

type Options struct {
	DSN                string
	MaxConnAttempts    int
	Directory          string
	TableName          string
	ClusterName        string
	Replicated         bool
	Compact            bool
	Interactive        bool
	MaxSQLOutputLength int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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