mirror of https://github.com/go-gorm/gorm.git
Add method New back
This commit is contained in:
parent
80576bbbbc
commit
287ae22ca6
7
main.go
7
main.go
|
@ -85,6 +85,13 @@ func (s *DB) DB() *sql.DB {
|
|||
return s.db.(*sql.DB)
|
||||
}
|
||||
|
||||
func (s *DB) New() *DB {
|
||||
clone := s.clone()
|
||||
clone.search = nil
|
||||
clone.Value = nil
|
||||
return clone
|
||||
}
|
||||
|
||||
// NewScope create scope for callbacks, including DB's search information
|
||||
func (db *DB) NewScope(value interface{}) *Scope {
|
||||
dbClone := db.clone()
|
||||
|
|
Loading…
Reference in New Issue