Update gorm.go
This commit is contained in:
parent
0daaf1747c
commit
36b41fadd4
18
gorm.go
18
gorm.go
@ -407,6 +407,23 @@ func (db *DB) getInstance() *DB {
|
|||||||
tx := &DB{Config: db.Config, Error: db.Error}
|
tx := &DB{Config: db.Config, Error: db.Error}
|
||||||
|
|
||||||
if db.clone == 1 {
|
if db.clone == 1 {
|
||||||
|
|
||||||
|
setings := sync.Map{}
|
||||||
|
d,e := db.Get("xs-uuid")
|
||||||
|
if e{
|
||||||
|
setings.Store("xs-uuid",d)
|
||||||
|
}
|
||||||
|
|
||||||
|
d,e = db.Get("xs-uuid-internal")
|
||||||
|
if e{
|
||||||
|
setings.Store("xs-uuid-internal",d)
|
||||||
|
}
|
||||||
|
d,e = db.Get("signed-user")
|
||||||
|
if e{
|
||||||
|
setings.Store("signed-user",d)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// clone with new statement
|
// clone with new statement
|
||||||
tx.Statement = &Statement{
|
tx.Statement = &Statement{
|
||||||
DB: tx,
|
DB: tx,
|
||||||
@ -415,6 +432,7 @@ func (db *DB) getInstance() *DB {
|
|||||||
Clauses: map[string]clause.Clause{},
|
Clauses: map[string]clause.Clause{},
|
||||||
Vars: make([]interface{}, 0, 8),
|
Vars: make([]interface{}, 0, 8),
|
||||||
SkipHooks: db.Statement.SkipHooks,
|
SkipHooks: db.Statement.SkipHooks,
|
||||||
|
Settings: setings,
|
||||||
}
|
}
|
||||||
if db.Config.PropagateUnscoped {
|
if db.Config.PropagateUnscoped {
|
||||||
tx.Statement.Unscoped = db.Statement.Unscoped
|
tx.Statement.Unscoped = db.Statement.Unscoped
|
||||||
|
Loading…
x
Reference in New Issue
Block a user