Documentation ¶
Index ¶
- type BasicMigration
- func (bmig *BasicMigration) Clean() error
- func (bmig *BasicMigration) Execute(db *sql.DB) error
- func (bmig *BasicMigration) ExecuteFromFile(db *sql.DB) error
- func (bmig *BasicMigration) ExecuteOnWrite(db *sql.DB) error
- func (bmig *BasicMigration) GetComponentVersion() string
- func (bmig *BasicMigration) Write() error
- func (bmig *BasicMigration) WriteOnExecute(db *sql.DB) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BasicMigration ¶
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
Click to show internal directories.
Click to hide internal directories.