-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtype.go
More file actions
52 lines (44 loc) · 1.08 KB
/
Copy pathtype.go
File metadata and controls
52 lines (44 loc) · 1.08 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
type GoType string
const (
GoTypeInt64 GoType = "int64"
GoTypeInt32 GoType = "int32"
GoTypeInt GoType = "int"
GoTypeFloat32 GoType = "float32"
GoTypeFloat64 GoType = "float64"
GoTypeTime GoType = "time.Time"
GoTypeString GoType = "string"
)
var GoTypeMap = map[string]GoType{
"tinyint": GoTypeInt64,
"smallint": GoTypeInt64,
"mediumint": GoTypeInt64,
"int": GoTypeInt64,
"bigint": GoTypeInt64,
"float": GoTypeFloat64,
"double": GoTypeFloat64,
"decimal": GoTypeFloat64,
"date": GoTypeTime,
"time": GoTypeTime,
"year": GoTypeTime,
"datetime": GoTypeTime,
"timestamp": GoTypeTime,
"char": GoTypeString,
"varchar": GoTypeString,
"tinyblob": GoTypeString,
"tinytext": GoTypeString,
"blob": GoTypeString,
"text": GoTypeString,
"mediumblob": GoTypeString,
"mediumtext": GoTypeString,
"longblob": GoTypeString,
"longtext": GoTypeString,
}
type TagType struct {
Prefix string
Suffix string
}
var TagTypeMap = map[string]TagType{
"json": {"", ""},
"gorm": {"column:", ""},
}