Skip to content

Commit

Permalink
Revert "fix: fix delete, insert, update tx statement"
Browse files Browse the repository at this point in the history
This reverts commit 8cb8992.
  • Loading branch information
lqs committed Jul 25, 2024
1 parent 396dd90 commit 1c7e60d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 13 deletions.
7 changes: 0 additions & 7 deletions delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,5 @@ func (s deleteStatus) Execute() (sql.Result, error) {
if err != nil {
return nil, err
}

// use transaction if it exists, otherwise use database.
// this is because when s.scope.Transaction is not nil,
// it must be built by transaction.
if s.scope.Transaction != nil {
return s.scope.Transaction.Execute(sqlString)
}
return s.scope.Database.Execute(sqlString)
}
3 changes: 0 additions & 3 deletions insert.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,5 @@ 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: 0 additions & 3 deletions update.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,5 @@ 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 1c7e60d

Please sign in to comment.