You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.2 KiB
Go

package cnf
6 years ago
// EImportsHead imports head options. import包含选项
var EImportsHead = map[string]string{
"stirng": `"string"`,
"time.Time": `"time"`,
"gorm.Model": `"github.com/jinzhu/gorm"`,
}
5 years ago
// TypeMysqlDicMp Accurate matching type.精确匹配类型
var TypeMysqlDicMp = map[string]string{
5 years ago
"int": "int",
"bigint": "int64",
"varchar": "string",
"char": "string",
"date": "time.Time",
5 years ago
"datetime": "time.Time",
"bit(1)": "bool",
5 years ago
"tinyint(1)": "bool",
"tinyint(1) unsigned": "bool",
"json": "string",
5 years ago
"text": "string",
5 years ago
"timestamp": "time.Time",
5 years ago
"double": "float64",
5 years ago
"mediumtext": "string",
5 years ago
}
// TypeMysqlMatchMp Fuzzy Matching Types.模糊匹配类型
var TypeMysqlMatchMp = map[string]string{
`^(tinyint)[(]\d+[)]`: "int8",
`^(smallint)[(]\d+[)]`: "int8",
`^(int)[(]\d+[)]`: "int",
`^(bigint)[(]\d+[)]`: "int64",
`^(char)[(]\d+[)]`: "string",
`^(varchar)[(]\d+[)]`: "string",
`^(decimal)[(]\d+,\d+[)]`: "float64",
5 years ago
`^(mediumint)[(]\d+[)]`: "string",
`^(double)[(]\d+,\d+[)]`: "float64",
`^(float)[(]\d+,\d+[)]`: "float64",
6 years ago
}