File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,8 @@ import (
22
22
)
23
23
24
24
const (
25
+ DefaultDriverName = "mysql"
26
+
25
27
AutoRandomTag = "auto_random()" // Treated as an auto_random field for tidb
26
28
)
27
29
@@ -80,7 +82,7 @@ func New(config Config) gorm.Dialector {
80
82
}
81
83
82
84
func (dialector Dialector ) Name () string {
83
- return "mysql"
85
+ return DefaultDriverName
84
86
}
85
87
86
88
// NowFunc return now func
@@ -107,7 +109,7 @@ func (dialector Dialector) Apply(config *gorm.Config) error {
107
109
108
110
func (dialector Dialector ) Initialize (db * gorm.DB ) (err error ) {
109
111
if dialector .DriverName == "" {
110
- dialector .DriverName = "mysql"
112
+ dialector .DriverName = DefaultDriverName
111
113
}
112
114
113
115
if dialector .DefaultDatetimePrecision == nil {
You can’t perform that action at this time.
0 commit comments