Documentation
¶
Index ¶
- Variables
- type Config
- type DBRepoAnnot
- type DBTool
- func (t *DBTool) Console(c *typgo.Context) error
- func (t *DBTool) CreateDB(c *typgo.Context) error
- func (t *DBTool) DropDB(c *typgo.Context) error
- func (t *DBTool) MigrateDB(c *typgo.Context) error
- func (t *DBTool) MigrationFile(c *typgo.Context) error
- func (t *DBTool) RollbackDB(c *typgo.Context) error
- func (t *DBTool) SeedDB(c *typgo.Context) error
- func (t *DBTool) Task() *typgo.Task
- type DBToolHandler
- type EntityTmplData
- type EnvKeys
- type Field
- type MySQLHandler
- type MySQLTool
- type PostgresHandler
- type PostgresTool
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultEnvKeys = &EnvKeys{
DBName: "DBNAME",
DBUser: "DBUSER",
DBPass: "DBPASS",
Host: "HOST",
Port: "PORT",
}
Functions ¶
This section is empty.
Types ¶
type DBRepoAnnot ¶
type DBRepoAnnot struct {
TagName string // By default is @dbrepo
}
DBRepoAnnot ...
func (*DBRepoAnnot) Annotation ¶ added in v0.9.21
func (m *DBRepoAnnot) Annotation() *typgen.Annotation
func (*DBRepoAnnot) GetDest ¶
func (*DBRepoAnnot) GetDest(file string) string
GetDest get destination
func (*DBRepoAnnot) Process ¶
func (m *DBRepoAnnot) Process(c *typgo.Context, directive typgen.Directives) error
Annotate Envconfig to prepare dependency-injection and env-file
type DBTool ¶
type DBTool struct {
DBToolHandler
Name string
EnvKeys *EnvKeys
MigrationSrc string
SeedSrc string
CreateFormat string
DropFormat string
DockerName string
}
func (*DBTool) MigrationFile ¶
MigrationFile seed database
func (*DBTool) RollbackDB ¶
RollbackDB rollback database
type DBToolHandler ¶ added in v0.9.21
type EntityTmplData ¶
type EntityTmplData struct {
typgen.Signature
Name string
Table string
Dialect string
CtorDB string
Pkg string
SourcePkg string
Dest string
Fields []*Field
Imports map[string]string
PrimaryKey *Field
}
EntityTmplData ...
type Field ¶
type Field struct {
Name string
Type string
Column string
PrimaryKey bool
DefaultValue string
SkipUpdate bool
}
Field repo
type MySQLHandler ¶ added in v0.9.21
type MySQLHandler struct{}
func (MySQLHandler) Connect ¶ added in v0.9.21
func (MySQLHandler) Connect(c *Config) (*sql.DB, error)
func (MySQLHandler) ConnectAdmin ¶ added in v0.9.21
func (MySQLHandler) ConnectAdmin(c *Config) (*sql.DB, error)
type MySQLTool ¶ added in v0.9.18
type PostgresHandler ¶ added in v0.9.21
type PostgresHandler struct{}
func (PostgresHandler) Connect ¶ added in v0.9.21
func (PostgresHandler) Connect(c *Config) (*sql.DB, error)
func (PostgresHandler) ConnectAdmin ¶ added in v0.9.21
func (PostgresHandler) ConnectAdmin(c *Config) (*sql.DB, error)
type PostgresTool ¶ added in v0.9.18
type PostgresTool struct {
Name string
EnvKeys *EnvKeys
MigrationSrc string
SeedSrc string
DockerName string
}
func (*PostgresTool) DBTool ¶ added in v0.9.18
func (t *PostgresTool) DBTool() *DBTool
func (*PostgresTool) Task ¶ added in v0.9.18
func (t *PostgresTool) Task() *typgo.Task
Task for postgres
Click to show internal directories.
Click to hide internal directories.