feat: added db transactions abstraction; cleaned up user registration; repos adapted new abstraction: all repos now support transactions, if present in ctx

This commit is contained in:
2026-09-01 14:55:20 +02:00
parent f87b0a0707
commit 2e3e82e776
14 changed files with 219 additions and 145 deletions
+23
View File
@@ -0,0 +1,23 @@
package repository
import "database/sql"
type Store struct {
*Transactor
Auth *AuthRepo
Invite *InviteRepo
List *ListRepo
User *UserRepo
}
func NewStore(db *sql.DB) *Store {
t := NewTransactor(db)
r := NewRepo(t)
return &Store{
Transactor: t,
Auth: &AuthRepo{r},
Invite: &InviteRepo{r},
List: &ListRepo{r},
User: &UserRepo{r},
}
}