Skip to content

Latest commit

 

History

History
37 lines (32 loc) · 926 Bytes

README.md

File metadata and controls

37 lines (32 loc) · 926 Bytes

sqlmig

go get -u github.com/codemodus/sqlmig

Usage

type DataProvider
type Regularizer
type Result
    func (r *Result) Err() error
    func (r *Result) String() string
    func (r *Result) Total() int
type Results
    func (rs Results) Errs() []error
    func (rs Results) ErrsErr() error
    func (rs Results) HasError() bool
    func (rs Results) String() string
    func (rs Results) Total() int
type SQLMig
    func New(db *sql.DB, driver, tablePrefix string) (*SQLMig, error)
    func (m *SQLMig) AddDataProviders(ps ...DataProvider)
    func (m *SQLMig) AddRegularizers(rs ...Regularizer)
    func (m *SQLMig) Migrate() Results
    func (m *SQLMig) Regularize(ctx context.Context) error
    func (m *SQLMig) RollBack() Results
type DataProvider interface {
    MigrationData() (name string, data map[string][]byte)
}

type Regularizer interface {
    Regularize(context.Context) error
}