Add method New back

This commit is contained in:
Jinzhu 2015-03-04 13:55:39 +08:00
parent 80576bbbbc
commit 287ae22ca6
1 changed files with 7 additions and 0 deletions

View File

@ -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()