astipatch

package module
v0.0.0-...-775d4d0 Latest Latest
Warning

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

Go to latest
Published: May 27, 2019 License: MIT Imports: 10 Imported by: 0

README

About

TODO

Examples

SQL

Run the following commands :

$ go run examples/sql/main.go init -db-addr <the db addr> -db-name <the db name> -db-password <your value> -db-username <your value> -v
$ go run examples/sql/main.go patch -db-addr <the db addr> -db-name <the db name> -db-password <your value> -db-username <your value> -v -astipatch-patches-directory-path examples/sql/patches/step1
$ go run examples/sql/main.go patch -db-addr <the db addr> -db-name <the db name> -db-password <your value> -db-username <your value> -v -astipatch-patches-directory-path examples/sql/patches/step2
$ go run examples/sql/main.go rollback -db-addr <the db addr> -db-name <the db name> -db-password <your value> -db-username <your value> -v -astipatch-patches-directory-path examples/sql/patches/step2
$ go run examples/sql/main.go rollback -db-addr <the db addr> -db-name <the db name> -db-password <your value> -db-username <your value> -v -astipatch-patches-directory-path examples/sql/patches/step2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	PatchesDirectoryPath = flag.String("astipatch-patches-directory-path", "", "the patches directory path")
)

Flags

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	PatchesDirectoryPath string `toml:"patches_directory_path"`
}

Configuration represents the patcher configuration

func FlagConfig

func FlagConfig() Configuration

FlagConfig generates a Configuration based on flags

type Patcher

type Patcher interface {
	Init() error
	Load(c Configuration) error
	Patch() error
	Rollback() error
}

Patcher represents an object capable of patching

func NewPatcherSQL

func NewPatcherSQL(conn *sqlx.DB, s Storer) Patcher

NewPatcherSQL creates a new SQL patcher

type Storer

type Storer interface {
	DeleteLastBatch() error
	Delta([]string) ([]string, error)
	Init() error
	InsertBatch([]string) error
	LastBatch() ([]string, error)
}

Storer represents an object capable of storing patch's state

func NewStorerSQL

func NewStorerSQL(conn *sqlx.DB) Storer

NewStorerSQL creates a new SQL storer

Directories

Path Synopsis
examples
sql

Jump to

Keyboard shortcuts

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