Skip to content

Commit f616ccd

Browse files
miskojinzhu
misko
authored andcommitted
1 parent 9d2b65f commit f616ccd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,10 @@ func (s *DB) Close() error {
124124
// DB get `*sql.DB` from current connection
125125
// If the underlying database connection is not a *sql.DB, returns nil
126126
func (s *DB) DB() *sql.DB {
127-
db, _ := s.db.(*sql.DB)
127+
db, ok := s.db.(*sql.DB)
128+
if !ok {
129+
panic("can't support full GORM on currently status, maybe this is a TX instance.")
130+
}
128131
return db
129132
}
130133

0 commit comments

Comments
 (0)