Add DialectName to database handle

This commit is contained in:
Thomas Boerger 2016-09-12 18:45:36 +02:00
parent 02f6ae3c4e
commit a8cecf2b8e
No known key found for this signature in database
GPG Key ID: 5A388F55283960B6

View File

@ -106,6 +106,11 @@ func (s *DB) NewScope(value interface{}) *Scope {
return &Scope{db: dbClone, Search: dbClone.search.clone(), Value: value} 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. // 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 { func (s *DB) CommonDB() sqlCommon {
return s.db return s.db