mirror of https://github.com/go-gorm/gorm.git
Adding GetDialect function (#1869)
This commit is contained in:
parent
35efe68ba7
commit
9044197ef9
|
@ -72,6 +72,12 @@ func RegisterDialect(name string, dialect Dialect) {
|
||||||
dialectsMap[name] = dialect
|
dialectsMap[name] = dialect
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// GetDialect gets the dialect for the specified dialect name
|
||||||
|
func GetDialect(name string) (dialect Dialect, ok bool) {
|
||||||
|
dialect, ok = dialectsMap[name]
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
// ParseFieldStructForDialect get field's sql data type
|
// ParseFieldStructForDialect get field's sql data type
|
||||||
var ParseFieldStructForDialect = func(field *StructField, dialect Dialect) (fieldValue reflect.Value, sqlType string, size int, additionalType string) {
|
var ParseFieldStructForDialect = func(field *StructField, dialect Dialect) (fieldValue reflect.Value, sqlType string, size int, additionalType string) {
|
||||||
// Get redirected field type
|
// Get redirected field type
|
||||||
|
|
Loading…
Reference in New Issue