Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdditionalComment ¶
type AdditionalComment struct {
Table string `yaml:"table"`
TableComment string `yaml:"tableComment"`
ColumnComments map[string]string `yaml:"columnComments"`
}
AdditionalComment is the struct for table relation from yaml
type AdditionalRelation ¶
type AdditionalRelation struct {
Table string `yaml:"table"`
Columns []string `yaml:"columns"`
ParentTable string `yaml:"parentTable"`
ParentColumns []string `yaml:"parentColumns"`
Def string `yaml:"def"`
}
AdditionalRelation is the struct for table relation from yaml
type ColumnCount ¶ added in v1.8.0
ColumnCount check table column count
func (ColumnCount) Check ¶ added in v1.8.0
func (r ColumnCount) Check(s *schema.Schema) []RuleWarn
Check table column count
func (ColumnCount) IsEnabled ¶ added in v1.8.0
func (r ColumnCount) IsEnabled() bool
IsEnabled return Rule is enabled or not
type Config ¶
type Config struct {
DSN string `yaml:"dsn"`
DocPath string `yaml:"docPath"`
Lint Lint `yaml:"lint"`
Relations []AdditionalRelation `yaml:"relations"`
Comments []AdditionalComment `yaml:"comments"`
}
Config is tbls config
func (*Config) LoadConfigFile ¶
LoadConfigFile load config file
type Lint ¶ added in v1.8.0
type Lint struct {
RequireTableComment RequireTableComment `yaml:"requireTableComment"`
RequireColumnComment RequireColumnComment `yaml:"requireColumnComment"`
NoRelationTables NoRelationTables `yaml:"noRelationTables"`
ColumnCount ColumnCount `yaml:"columnCount"`
}
Lint is the struct for lint config
type NoRelationTables ¶ added in v1.8.0
NoRelationTables check no relation table
func (NoRelationTables) Check ¶ added in v1.8.0
func (r NoRelationTables) Check(s *schema.Schema) []RuleWarn
Check table relation
func (NoRelationTables) IsEnabled ¶ added in v1.8.0
func (r NoRelationTables) IsEnabled() bool
IsEnabled return Rule is enabled or not
type RequireColumnComment ¶ added in v1.8.0
type RequireColumnComment struct {
Enabled bool `yaml:"enabled"`
}
RequireColumnComment check column comment
func (RequireColumnComment) Check ¶ added in v1.8.0
func (r RequireColumnComment) Check(s *schema.Schema) []RuleWarn
Check column comment
func (RequireColumnComment) IsEnabled ¶ added in v1.8.0
func (r RequireColumnComment) IsEnabled() bool
IsEnabled return Rule is enabled or not
type RequireTableComment ¶ added in v1.8.0
type RequireTableComment struct {
Enabled bool `yaml:"enabled"`
}
RequireTableComment check table comment
func (RequireTableComment) Check ¶ added in v1.8.0
func (r RequireTableComment) Check(s *schema.Schema) []RuleWarn
Check table comment
func (RequireTableComment) IsEnabled ¶ added in v1.8.0
func (r RequireTableComment) IsEnabled() bool
IsEnabled return Rule is enabled or not
Click to show internal directories.
Click to hide internal directories.