WASAPhoto/service/database/db-transactions.go

19 lines
388 B
Go
Raw Normal View History

package database
import "database/sql"
2023-01-10 01:21:53 +01:00
// dbtransaction is a struct to represent an SQL transaction, it implements the DBTransaction interface
type dbtransaction struct {
c *sql.Tx
}
func (tx *dbtransaction) Commit() error {
2023-01-10 01:21:53 +01:00
// Commit the SQL transaction
return tx.c.Commit()
}
func (tx *dbtransaction) Rollback() error {
2023-01-10 01:21:53 +01:00
// Rollback the SQL transaction
return tx.c.Rollback()
}