Documentation
¶
Index ¶
- Constants
- Variables
- func GenCodeByTableDefYaml(ctx context.Context, tableName string, genOptions *GenOptions) error
- func GetColumnLength(columnType string) int
- func GetDbType(columnType string) string
- func GetGoModule(file string) (string, error)
- func GetGoModuleName() (string, error)
- func IsDateObject(dataType string) bool
- func IsExistInArray(value string, array []string) bool
- func IsNumberObject(dataType string) bool
- func IsStringObject(dataType string) bool
- func IsTimeObject(dataType string) bool
- func LoadTableDefYaml(ctx context.Context, tableName string, yamlInputPath string, ...) (*tableDef, error)
- func ParseDblink(dblink string) error
- func SplitComma(str string) []string
- func TemplateEngine() *gview.View
- func TrimBreak(str string) (rStr string, err error)
- func WriteFile(fileName, data string, cover bool) (err error)
- type GenOptions
- type ImportOptions
Constants ¶
View Source
const ( RelatedTablePrefix = "Rltd" RelatedTableJsonPrefix = "rltd" )
Variables ¶
View Source
var ( ColumnTypeStr = []string{"char", "varchar", "varchar2", "tinytext", "text", "mediumtext", "longtext", "binary", "varbinary", "blob"} ColumnTypeDate = []string{"date"} ColumnTypeTime = []string{"datetime", "time", "timestamp"} ColumnTypeNumber = []string{"tinyint", "smallint", "mediumint", "int", "integer", "bigint", "float", "double", "decimal", "numeric", "bit"} ColumnNameNotEdit = []string{"created_by", "created_at", "updated_by", "updated_at", "deleted_at"} ColumnNameNotList = []string{"updated_by", "updated_at", "deleted_at"} ColumnNameNotDetail = []string{"updated_by", "updated_at", "deleted_at"} ColumnNameNotQuery = []string{"updated_by", "updated_at", "deleted_at", "remark"} )
View Source
var DbTableImporter = new(dbTableImporter)
Functions ¶
func GenCodeByTableDefYaml ¶
func GenCodeByTableDefYaml(ctx context.Context, tableName string, genOptions *GenOptions) error
func GetGoModule ¶
func GetGoModuleName ¶
func IsExistInArray ¶
IsExistInArray 判断 value 是否存在在切片array中
func LoadTableDefYaml ¶
func ParseDblink ¶
func SplitComma ¶
func TemplateEngine ¶
Types ¶
type GenOptions ¶
type ImportOptions ¶
type ImportOptions struct {
BackendPackage string
FrontendModule string
GoModuleName string
TableNames []string
TablePrefixesOnly []string
RemoveTablePrefixes []string
YamlOutputPath string
Prefix string
SeparatePackage bool
TemplateCategory string
Author string
Overwrite bool
ShowDetail bool
IsRpc bool
}
Click to show internal directories.
Click to hide internal directories.