scriptup

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MigrateDown

func MigrateDown(cfg *Config, steps int) error

func MigrateUp

func MigrateUp(cfg *Config, steps int) error

func NewMigrationFile

func NewMigrationFile(cfg *Config, name string) error

NewMigrationFile creates a new migration file.

func Status

func Status(cfg *Config) error

Types

type Config

type Config struct {
	FileDB       string `yaml:"file_db,omitempty"`
	Dialect      string `yaml:"dialect"`
	Host         string `yaml:"host"`
	Port         int    `yaml:"port"`
	User         string `yaml:"user"`
	Password     string `yaml:"pass,omitempty"`
	SSLMode      string `yaml:"sslmode,omitempty"`
	DatabaseName string `yaml:"db_name"`
	Table        string `yaml:"table"`
	Directory    string `yaml:"dir"`
	Executor     string `yaml:"executor"`
}

func GetConfig

func GetConfig(env string) *Config

GetConfig loads the config for the given environment from the yaml file.

func (*Config) InitMigrationState

func (cfg *Config) InitMigrationState() (*migration_state.MigrationState, error)

InitMigrationState sets up the storage and the MigrationState according to the config.

func (*Config) InitStorage

func (cfg *Config) InitStorage() (storage.Storage, error)

InitStorage retrieves and opens the storage according to the configuration.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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