Added: creating database, sql tx repository
This commit is contained in:
14
internal/db/irepository.go
Normal file
14
internal/db/irepository.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user