mirror of
https://github.com/notherealmarco/WASAPhoto.git
synced 2025-03-13 13:35:23 +01:00
18 lines
388 B
Go
18 lines
388 B
Go
package database
|
|
|
|
import "database/sql"
|
|
|
|
// 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 {
|
|
// Commit the SQL transaction
|
|
return tx.c.Commit()
|
|
}
|
|
|
|
func (tx *dbtransaction) Rollback() error {
|
|
// Rollback the SQL transaction
|
|
return tx.c.Rollback()
|
|
}
|