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)
|
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
|
// NewScope create scope for callbacks, including DB's search information
|
||||||
func (db *DB) NewScope(value interface{}) *Scope {
|
func (db *DB) NewScope(value interface{}) *Scope {
|
||||||
dbClone := db.clone()
|
dbClone := db.clone()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user