Documentation ¶
Index ¶
Constants ¶
View Source
const (
// MySQLDriverName represents the mysql driver name.
MySQLDriverName = "mysql"
)
Variables ¶
This section is empty.
Functions ¶
func ConvertAllTable ¶
func ConvertTable ¶
ConvertTable converts mysql table fields to golang model structure by command config.
Types ¶
type CMDConfig ¶
type CMDConfig struct { DBConfig PackageName string `json:"package_name"` StructName string `json:"struct_name"` EnableInitialism bool `json:"enable_initialism"` EnableFieldComment bool `json:"enable_field_comment"` EnableSqlNull bool `json:"enable_sql_null"` EnableGureguNull bool `json:"enable_guregu_null"` EnableJsonTag bool `json:"enable_json_tag"` EnableXmlTag bool `json:"enable_xml_tag"` EnableGormTag bool `json:"enable_gorm_tag"` EnableXormTag bool `json:"enable_xorm_tag"` EnableBeegoTag bool `json:"enable_beego_tag"` EnableGoroseTag bool `json:"enable_gorose_tag"` EnableGormV2Tag bool `json:"enable_gorm_v2_tag"` }
CMDConfig represents the config of the running grom command line.
type ColumnInfo ¶
type ColumnInfo struct { Name string `mysql:"COLUMN_NAME"` DataType string `mysql:"DATA_TYPE"` Type string `mysql:"COLUMN_TYPE"` Default string `mysql:"COLUMN_DEFAULT"` Comment string `mysql:"COLUMN_COMMENT"` Length int64 `mysql:"CHARACTER_MAXIMUM_LENGTH"` Precision int64 `mysql:"NUMERIC_PRECISION"` Scale int64 `mysql:"NUMERIC_SCALE"` Position int `mysql:"ORDINAL_POSITION"` IsPrimaryKey bool `mysql:"COLUMN_KEY"` IsAutoIncrement bool `mysql:"EXTRA"` IsUnsigned bool `mysql:"COLUMN_TYPE"` IsNullable bool `mysql:"IS_NULLABLE"` Indexes []*IndexInfo `mysql:"-"` UniqueIndexes []*IndexInfo `mysql:"-"` }
ColumnInfo represents the information of the column.
type DBConfig ¶
type DBConfig struct { Host string `json:"host"` Port int `json:"port"` User string `json:"user"` Password string `json:"password"` Database string `json:"database"` Table string `json:"table"` OutDir string `json:"outdir"` }
DBConfig represents the config of the connected database.
Click to show internal directories.
Click to hide internal directories.