From a8cecf2b8edcce50649a52af7a63338264e64427 Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 12 Sep 2016 18:45:36 +0200 Subject: [PATCH] Add DialectName to database handle --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index bce3c56b..70f05c06 100644 --- a/main.go +++ b/main.go @@ -106,6 +106,11 @@ func (s *DB) NewScope(value interface{}) *Scope { return &Scope{db: dbClone, Search: dbClone.search.clone(), Value: value} } +// DialectName returns the name of the used dialect. +func (s *DB) DialectName() string { + return s.dialect.GetName() +} + // CommonDB return the underlying `*sql.DB` or `*sql.Tx` instance, mainly intended to allow coexistence with legacy non-GORM code. func (s *DB) CommonDB() sqlCommon { return s.db