Documentation
¶
Overview ¶
Package schema provides CLI commands
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cmd ¶
type Cmd struct {
Generate GenerateCmd `cmd:"" help:"generate Go model for database schema"`
Columns PrintColumnsCmd `cmd:"" help:"prints database schema"`
Tables PrintTablesCmd `cmd:"" help:"prints database tables and dependencies"`
Views PrintViewsCmd `cmd:"" help:"prints database views and dependencies"`
ForeignKeys PrintFKCmd `cmd:"" help:"prints Foreign Keys"`
}
Cmd base command for schema
type GenerateCmd ¶
type GenerateCmd struct {
DB string `help:"database name" required:""`
Schema []string `help:"optional schema name to filter"`
Table []string `help:"optional, list of tables, default: all tables"`
View []string `help:"optional, list of views"`
Dependencies bool `help:"optional, to discover all dependencies"`
OutModel string `help:"folder name to store model files"`
OutSchema string `help:"folder name to store schema files"`
PkgModel string `help:"package name to override from --out-model path"`
PkgSchema string `help:"package name to override from --out-schema path"`
StructSuffix string `help:"optional, suffix for struct names"`
Imports []string `help:"optional go imports"`
UseSchema bool `help:"optional, use schema name in table name"`
TypesDef string `help:"optional, path to types definition file"`
}
GenerateCmd generates database schema
type PrintColumnsCmd ¶
type PrintColumnsCmd struct {
DB string `help:"database name" required:""`
Schema []string `help:"optional schema name to filter"`
Table []string `help:"optional, list of tables, default: all tables"`
Dependencies bool `help:"optional, to discover all dependencies"`
Views bool `help:"optional, to include views"`
}
PrintColumnsCmd prints database schema
type PrintFKCmd ¶
type PrintFKCmd struct {
DB string `help:"database name" required:""`
Schema []string `help:"optional schema name to filter"`
Table []string `help:"optional, list of tables, default: all tables"`
}
PrintFKCmd prints database FK
type PrintTablesCmd ¶
type PrintTablesCmd struct {
DB string `help:"database name" required:""`
Schema []string `help:"optional schema name to filter"`
Table []string `help:"optional, list of tables, default: all tables"`
Views bool `help:"optional, to include views"`
}
PrintTablesCmd prints database tables with dependencies
type PrintViewsCmd ¶
type PrintViewsCmd struct {
DB string `help:"database name" required:""`
Schema []string `help:"optional schema name to filter"`
View []string `help:"optional, list of views, default: all views"`
}
PrintViewsCmd prints database tables with dependencies
Click to show internal directories.
Click to hide internal directories.