Feat: player stats [WIP]
This commit is contained in:
		| @@ -2,7 +2,6 @@ package repos | ||||
|  | ||||
| import ( | ||||
| 	"context" | ||||
| 	"gralias/config" | ||||
| 	"log/slog" | ||||
| 	"os" | ||||
| 	"sync" | ||||
| @@ -20,6 +19,7 @@ type AllRepos interface { | ||||
| 	WordCardsRepo | ||||
| 	SettingsRepo | ||||
| 	CardMarksRepo | ||||
| 	PlayerStatsRepo | ||||
| 	InitTx(ctx context.Context) (context.Context, *sqlx.Tx, error) | ||||
| 	Close() | ||||
| } | ||||
| @@ -32,12 +32,7 @@ type RepoProvider struct { | ||||
|  | ||||
| var RP AllRepos | ||||
|  | ||||
| func init() { | ||||
| 	cfg := config.LoadConfigOrDefault("") | ||||
| 	// sqlite3 has lock on write, so we need to have only one connection per whole app | ||||
| 	// https://github.com/mattn/go-sqlite3/issues/274#issuecomment-232942571 | ||||
| 	RP = NewRepoProvider(cfg.DBPath) | ||||
| } | ||||
|  | ||||
|  | ||||
| func NewRepoProvider(pathToDB string) *RepoProvider { | ||||
| 	db, err := sqlx.Connect("sqlite3", pathToDB) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder