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

Method Commit

finisher_api.go:716–723  ·  view source on GitHub ↗

Commit commits the changes in a transaction

()

Source from the content-addressed store, hash-verified

714
715// Commit commits the changes in a transaction
716func (db *DB) Commit() *DB {
717 if committer, ok := db.Statement.ConnPool.(TxCommitter); ok && committer != nil && !reflect.ValueOf(committer).IsNil() {
718 db.AddError(committer.Commit())
719 } else {
720 db.AddError(ErrInvalidTransaction)
721 }
722 return db
723}
724
725// Rollback rollbacks the changes in a transaction
726func (db *DB) Rollback() *DB {

Callers

nothing calls this directly

Calls 2

AddErrorMethod · 0.95
CommitMethod · 0.65

Tested by

no test coverage detected