migration

package
v0.0.0-...-4e5a105 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(name string, text string, locals ...map[string]interface{}) string

Types

type Helper

type Helper interface {
	Version() int
	GetRevision(ctx context.Context, tx *sql.Tx) (int, error)
	SetRevision(ctx context.Context, tx *sql.Tx, id int) error
	GetVersion(ctx context.Context, tx *sql.Tx) (int, error)
	SetVersion(ctx context.Context, tx *sql.Tx, version int) error
	TableExists(ctx context.Context, tx *sql.Tx) (bool, error)
	RenderSQL(sql string, locals ...map[string]interface{}) string
}

type Revision

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

func SQL

func SQL(id int, sql string) Revision

type Revisions

type Revisions []Revision

func (Revisions) Run

func (revisions Revisions) Run(ctx context.Context, db *sql.DB, helper Helper) error

Jump to

Keyboard shortcuts

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