Add NewDB as a Shortcut Call
This commit is contained in:
parent
8f37cb0195
commit
7a55fef94c
5
gorm.go
5
gorm.go
@ -248,6 +248,11 @@ func (db *DB) Debug() (tx *DB) {
|
||||
})
|
||||
}
|
||||
|
||||
// NewDB clone a new db connection without search conditions
|
||||
func (db *DB) NewDB() *DB {
|
||||
return db.Session(&Session{NewDB: true})
|
||||
}
|
||||
|
||||
// Set store value with key into current db instance's context
|
||||
func (db *DB) Set(key string, value interface{}) *DB {
|
||||
tx := db.getInstance()
|
||||
|
Loading…
x
Reference in New Issue
Block a user