Added: creating database, sql tx repository

This commit is contained in:
Oliwier Adamczyk
2025-10-04 15:11:20 +02:00
parent 1aa78d10c5
commit fdd1c98e75
10 changed files with 159 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
package db
import "database/sql"
type ITxRepository interface {
// Creates a new tx.
Begin() (*sql.Tx, error)
// Rollbacks tx's data or returns an error to the given error's pointer address.
RollbackOnError(*sql.Tx, *error)
// Applies changes to the database.
Commit(*sql.Tx) error
}