sqlmig

package module
v0.1.0 Latest Latest
Warning

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

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

README

sqlmig

go get -u github.com/codemodus/sqlmig

Usage

type MigrationGetter
type Migrator
type Regularizer
type Result
    func (r *Result) Directory() string
    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 string) (*SQLMig, error)
    func (m *SQLMig) AddMigrations(srcs ...MigrationGetter)
    func (m *SQLMig) AddRegularizations(regs ...Regularizer)
    func (m *SQLMig) Migrate() Results
    func (m *SQLMig) Regularize(ctx context.Context) error
    func (m *SQLMig) RollBack() Results
    func (m *SQLMig) RunMigrations(src MigrationGetter, up bool) *Result
type MigrationGetter interface {
    MigrationName() string
    MigrationAssetDirectory() string
    MigrationAssetNames(dir string) (filenames []string, err error)
    MigrationAsset(filename string) (data []byte, err error)
}

type Migrator interface {
    MigrationGetter
    Regularizer
}

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 MigrationGetter

type MigrationGetter interface {
	MigrationName() string
	MigrationAssetDirectory() string
	MigrationAssetNames(dir string) (filenames []string, err error)
	MigrationAsset(filename string) (data []byte, err error)
}

MigrationGetter ...

type Migrator

type Migrator interface {
	MigrationGetter
	Regularizer
}

Migrator ...

type Regularizer

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

Regularizer ...

type Result

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

Result ...

func (*Result) Directory

func (r *Result) Directory() string

Directory ...

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 string) (*SQLMig, error)

New ...

func (*SQLMig) AddMigrations

func (m *SQLMig) AddMigrations(srcs ...MigrationGetter)

AddMigrations ...

func (*SQLMig) AddRegularizations

func (m *SQLMig) AddRegularizations(regs ...Regularizer)

AddRegularizations ...

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 ...

func (*SQLMig) RunMigrations

func (m *SQLMig) RunMigrations(src MigrationGetter, up bool) *Result

RunMigrations ...

Jump to

Keyboard shortcuts

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