Commit commits the changes in a transaction
()
| 714 | |
| 715 | // Commit commits the changes in a transaction |
| 716 | func (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 |
| 726 | func (db *DB) Rollback() *DB { |