migrations

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: LGPL-2.1 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicMigration

type BasicMigration struct {
	MigrationQuery string
	ToFile         string
	IsImportant    bool
}

BasicMigration just structure that will write query in file and execute it isImportant is a boolean value. If it true functions will panic otherwise not

func NewBasicMigration

func NewBasicMigration(query string, toFile string, isImportant bool) BasicMigration

func (*BasicMigration) Clean

func (bmig *BasicMigration) Clean() error

function clean will delete file

func (*BasicMigration) Execute

func (bmig *BasicMigration) Execute(db *sql.DB) error

execute function will run query that stored in structure NOT IN FILE for execution from migration file you will use ExecuteFromFile

func (*BasicMigration) ExecuteFromFile

func (bmig *BasicMigration) ExecuteFromFile(db *sql.DB) error

ExecuteFromFile will execute query from file

func (*BasicMigration) ExecuteOnWrite added in v0.0.5

func (bmig *BasicMigration) ExecuteOnWrite(db *sql.DB) error

this function will write migration query to file and then execute it

func (*BasicMigration) GetComponentVersion added in v0.1.0

func (bmig *BasicMigration) GetComponentVersion() string

func (*BasicMigration) Write

func (bmig *BasicMigration) Write() error

this function will create file and write to it query it will panic if something goes wrong

func (*BasicMigration) WriteOnExecute added in v0.1.0

func (bmig *BasicMigration) WriteOnExecute(db *sql.DB) error

Jump to

Keyboard shortcuts

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