sqlmig

package module
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: MIT Imports: 5 Imported by: 1

README

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
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataProvider added in v0.2.0

type DataProvider interface {
	MigrationData() (name string, data map[string][]byte)
}

DataProvider ...

type Regularizer

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

Regularizer ...

type Result

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

Result ...

func (*Result) Err

func (r *Result) Err() error

Err ...

func (*Result) String

func (r *Result) String() string

func (*Result) Total

func (r *Result) Total() int

Total ...

type Results

type Results []*Result

Results ...

func (Results) Errs

func (rs Results) Errs() []error

Errs ...

func (Results) ErrsErr

func (rs Results) ErrsErr() error

ErrsErr ...

func (Results) HasError

func (rs Results) HasError() bool

HasError ...

func (Results) String

func (rs Results) String() string

func (Results) Total

func (rs Results) Total() int

Total ...

type SQLMig

type SQLMig struct {
	*sql.DB
	// contains filtered or unexported fields
}

SQLMig ...

func New

func New(db *sql.DB, driver, tablePrefix string) (*SQLMig, error)

New ...

func (*SQLMig) AddDataProviders added in v0.2.0

func (m *SQLMig) AddDataProviders(ps ...DataProvider)

AddDataProviders ...

func (*SQLMig) AddRegularizers added in v0.1.1

func (m *SQLMig) AddRegularizers(rs ...Regularizer)

AddRegularizers ...

func (*SQLMig) Migrate

func (m *SQLMig) Migrate() Results

Migrate ...

func (*SQLMig) Regularize

func (m *SQLMig) Regularize(ctx context.Context) error

Regularize ...

func (*SQLMig) RollBack

func (m *SQLMig) RollBack() Results

RollBack ...

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳