From 9044197ef935c0969d94cbcfba55ccb94d269bed Mon Sep 17 00:00:00 2001 From: Illya Busigin Date: Wed, 2 May 2018 09:38:52 -0500 Subject: [PATCH] Adding GetDialect function (#1869) --- dialect.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dialect.go b/dialect.go index 5f6439c1..506a6e86 100644 --- a/dialect.go +++ b/dialect.go @@ -72,6 +72,12 @@ func RegisterDialect(name string, dialect 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 var ParseFieldStructForDialect = func(field *StructField, dialect Dialect) (fieldValue reflect.Value, sqlType string, size int, additionalType string) { // Get redirected field type