mirror of
https://github.com/tangpanqing/aorm.git
synced 2025-11-03 10:10:58 +08:00
Fix bugs
This commit is contained in:
@@ -519,6 +519,25 @@ func testTransaction(db *sql.DB) {
|
||||
return
|
||||
}
|
||||
|
||||
_, errCount := aorm.Use(tx).Debug(true).Where(&Person{
|
||||
Id: aorm.IntFrom(id),
|
||||
}).Count("*")
|
||||
if errCount != nil {
|
||||
fmt.Println(errCount)
|
||||
tx.Rollback()
|
||||
return
|
||||
}
|
||||
|
||||
var person Person
|
||||
errPerson := aorm.Use(tx).Debug(true).Where(&Person{
|
||||
Id: aorm.IntFrom(id),
|
||||
}).GetOne(&person)
|
||||
if errPerson != nil {
|
||||
fmt.Println(errPerson)
|
||||
tx.Rollback()
|
||||
return
|
||||
}
|
||||
|
||||
countUpdate, errUpdate := aorm.Use(tx).Debug(true).Where(&Person{
|
||||
Id: aorm.IntFrom(id),
|
||||
}).Update(&Person{
|
||||
|
||||
Reference in New Issue
Block a user