Skip to content

Commit

Permalink
fix: fix delete, insert, update tx statement
Browse files Browse the repository at this point in the history
  • Loading branch information
VarusHsu committed Feb 7, 2024
1 parent 9a36179 commit 8cb8992
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,5 +91,8 @@ func (s deleteStatus) Execute() (sql.Result, error) {
if err != nil {
return nil, err
}
if s.scope.Transaction != nil {
return s.scope.Transaction.Execute(sqlString)
}
return s.scope.Database.Execute(sqlString)
}
3 changes: 3 additions & 0 deletions insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,5 +187,8 @@ func (s insertStatus) Execute() (result sql.Result, err error) {
if err != nil {
return nil, err
}
if s.scope.Transaction != nil {
return s.scope.Transaction.Execute(sqlString)
}
return s.scope.Database.Execute(sqlString)
}
3 changes: 3 additions & 0 deletions update.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,5 +125,8 @@ func (s updateStatus) Execute() (sql.Result, error) {
if err != nil {
return nil, err
}
if s.scope.Transaction != nil {
return s.scope.Transaction.Execute(sqlString)
}
return s.scope.Database.Execute(sqlString)
}

0 comments on commit 8cb8992

Please sign in to comment.