MCPcopy
hub / github.com/go-gorm/gorm / Rollback

Method Rollback

finisher_api.go:726–735  ·  view source on GitHub ↗

Rollback rollbacks the changes in a transaction

()

Source from the content-addressed store, hash-verified

724
725// Rollback rollbacks the changes in a transaction
726func (db *DB) Rollback() *DB {
727 if committer, ok := db.Statement.ConnPool.(TxCommitter); ok && committer != nil {
728 if !reflect.ValueOf(committer).IsNil() {
729 db.AddError(committer.Rollback())
730 }
731 } else {
732 db.AddError(ErrInvalidTransaction)
733 }
734 return db
735}
736
737func (db *DB) SavePoint(name string) *DB {
738 if savePointer, ok := db.Dialector.(SavePointerDialectorInterface); ok {

Callers

nothing calls this directly

Calls 2

AddErrorMethod · 0.95
RollbackMethod · 0.65

Tested by

no test coverage detected