Adding GetDialect function (#1869)

This commit is contained in:
Illya Busigin 2018-05-02 09:38:52 -05:00 committed by Jinzhu
parent 35efe68ba7
commit 9044197ef9
1 changed files with 6 additions and 0 deletions

View File

@ -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