Documentation
¶
Index ¶
- func Console(ctx *typictx.ActionContext) (err error)
- func CreateDB(ctx *typictx.ActionContext) (err error)
- func DropDB(ctx *typictx.ActionContext) (err error)
- func MigrateDB(ctx *typictx.ActionContext) (err error)
- func Module() *typictx.Module
- func RollbackDB(ctx *typictx.ActionContext) (err error)
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Console ¶
func Console(ctx *typictx.ActionContext) (err error)
Console to run psql with username/password as in configuration
func CreateDB ¶
func CreateDB(ctx *typictx.ActionContext) (err error)
CreateDB is tool to create new database
func MigrateDB ¶
func MigrateDB(ctx *typictx.ActionContext) (err error)
MigrateDB is tool to migrate database
func RollbackDB ¶
func RollbackDB(ctx *typictx.ActionContext) (err error)
RollbackDB is tool to rollback database
Types ¶
type Config ¶
type Config struct {
DbName string `required:"true"`
User string `required:"true" default:"postgres"`
Password string `required:"true" default:"pgpass"`
Host string `default:"localhost"`
Port int `default:"5432"`
MigrationSrc string `default:"scripts/migration"`
}
Config is postgres configuration
func (*Config) AdminDataSource ¶
AdminDataSource return connection string for adminitration script
func (*Config) DataSource ¶
DataSource return connection string
func (*Config) DatabaseName ¶
DatabaseName return the database name
func (*Config) MigrationSource ¶
MigrationSource return the migration source
Click to show internal directories.
Click to hide internal directories.