Skip to content

Commit

Permalink
fix: fix db switch error in transaction (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
weloe authored Apr 14, 2023
1 parent 089b807 commit d7df6d8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@ func InitDbResolver(dbArr []gorm.Dialector, dbNames []string) (DbPool, error) {

func NewAdapterByMulDb(dbPool DbPool, dbName string, prefix string, tableName string) (*Adapter, error) {
//change DB
dbPool.switchDb(dbName)
db := dbPool.switchDb(dbName)

return NewAdapterByDBUseTableName(dbPool.source, prefix, tableName)
return NewAdapterByDBUseTableName(db, prefix, tableName)
}

// NewFilteredAdapter is the constructor for FilteredAdapter.
Expand Down

0 comments on commit d7df6d8

Please sign in to comment.