Documentation
¶
Index ¶
- Variables
- func BuildPlugin(fileName string) (string, error)
- func CreateConnection(c GormCliConfig) (string, error)
- func CreateMigration(purpose string) (string, error)
- func DownMigration(db *gorm.DB, files []os.FileInfo, step int64) error
- func NewDB() *gorm.DB
- func RemovePlugin(goFileName string) error
- func UpMigrate(db *gorm.DB, files []os.FileInfo) error
- type GormCliConfig
- type GormMeta
- type Migration
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrMigrationCanceled = errors.New("rollback migration canceled") ErrEmptyPurpose = errors.New("missing purpose when creating migration") ErrDuplicatedMigration = errors.New("migration exists") ErrNoMigration = errors.New("running with no migration") )
View Source
var MigrationTargetFolder string
MigrationTargetFolder is the migration folder target.
Functions ¶
func BuildPlugin ¶
func CreateConnection ¶
func CreateConnection(c GormCliConfig) (string, error)
CreateConnection - Create the migration file with template.
func CreateMigration ¶
CreateMigration - Create the migration file with template.
func DownMigration ¶
DownMigration - Rollback migration
func RemovePlugin ¶
Types ¶
type GormCliConfig ¶
type GormCliConfig struct { DB struct { Dialects string Port string Host string User string Password string Dbname string Charset string SSLMode string TimeZone string } Migration struct { Path string } }
GormCliConfig is the config for how gorm-cli connecting to DB
Click to show internal directories.
Click to hide internal directories.