Add SQLite persistence, import-snapshot tool, and karma functionality

This commit is contained in:
Ilya Groshev
2026-04-20 09:57:47 +03:00
parent c9ad3fa4f4
commit c33e738fd5
70 changed files with 4151 additions and 833 deletions
+25
View File
@@ -0,0 +1,25 @@
package sqlite
import (
"database/sql"
"time"
"lunar-tear/server/internal/store"
)
type SQLiteStore struct {
db *sql.DB
clock store.Clock
}
var (
_ store.UserRepository = (*SQLiteStore)(nil)
_ store.SessionRepository = (*SQLiteStore)(nil)
)
func New(db *sql.DB, clock store.Clock) *SQLiteStore {
if clock == nil {
clock = time.Now
}
return &SQLiteStore{db: db, clock: clock}
}