-
-
Notifications
You must be signed in to change notification settings - Fork 361
/
def.go
36 lines (33 loc) · 1.09 KB
/
def.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package cnf
// EImportsHead imports head options. import包含选项
var EImportsHead = map[string]string{
"stirng": `"string"`,
"time.Time": `"time"`,
"gorm.Model": `"github.com/jinzhu/gorm"`,
}
// TypeMysqlDicMp Accurate matching type.精确匹配类型
var TypeMysqlDicMp = map[string]string{
"int": "int",
"bigint": "int64",
"varchar": "string",
"char": "string",
"date": "time.Time",
"datetime": "time.Time",
"bit(1)": "bool",
"tinyint(1)": "bool",
"tinyint(1) unsigned": "bool",
"json": "string",
"text": "string",
"timestamp": "time.Time",
"double": "float64",
}
// 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",
}