Skip to content

Commit 4fc25c6

Browse files
author
Hein
committed
fix(db): correct connection pool assignment in GORM adapter
1 parent 16a960d commit 4fc25c6

File tree

1 file changed

+10
-10
lines changed
  • pkg/common/adapters/database

1 file changed

+10
-10
lines changed

pkg/common/adapters/database/gorm.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,14 @@ func syncGormConnPool(target, fresh *gorm.DB) {
7777
}
7878

7979
if target.Config != nil && fresh.Config != nil {
80-
target.Config.ConnPool = fresh.Config.ConnPool
80+
target.ConnPool = fresh.ConnPool
8181
}
8282

8383
if target.Statement != nil {
8484
if fresh.Statement != nil && fresh.Statement.ConnPool != nil {
8585
target.Statement.ConnPool = fresh.Statement.ConnPool
8686
} else if fresh.Config != nil {
87-
target.Statement.ConnPool = fresh.Config.ConnPool
87+
target.Statement.ConnPool = fresh.ConnPool
8888
}
8989
target.Statement.DB = target
9090
}
@@ -653,10 +653,10 @@ func (g *GormSelectQuery) Exists(ctx context.Context) (exists bool, err error) {
653653

654654
// GormInsertQuery implements InsertQuery for GORM
655655
type GormInsertQuery struct {
656-
db *gorm.DB
656+
db *gorm.DB
657657
reconnect func(...*gorm.DB) error
658-
model interface{}
659-
values map[string]interface{}
658+
model interface{}
659+
values map[string]interface{}
660660
}
661661

662662
func (g *GormInsertQuery) Model(model interface{}) common.InsertQuery {
@@ -715,10 +715,10 @@ func (g *GormInsertQuery) Exec(ctx context.Context) (res common.Result, err erro
715715

716716
// GormUpdateQuery implements UpdateQuery for GORM
717717
type GormUpdateQuery struct {
718-
db *gorm.DB
718+
db *gorm.DB
719719
reconnect func(...*gorm.DB) error
720-
model interface{}
721-
updates interface{}
720+
model interface{}
721+
updates interface{}
722722
}
723723

724724
func (g *GormUpdateQuery) Model(model interface{}) common.UpdateQuery {
@@ -815,9 +815,9 @@ func (g *GormUpdateQuery) Exec(ctx context.Context) (res common.Result, err erro
815815

816816
// GormDeleteQuery implements DeleteQuery for GORM
817817
type GormDeleteQuery struct {
818-
db *gorm.DB
818+
db *gorm.DB
819819
reconnect func(...*gorm.DB) error
820-
model interface{}
820+
model interface{}
821821
}
822822

823823
func (g *GormDeleteQuery) Model(model interface{}) common.DeleteQuery {

0 commit comments

Comments
 (0)