rename Storage struct to SQLiteStorage

This commit is contained in:
nkanaev
2026-06-07 23:17:07 +01:00
parent 76adcf0d62
commit dc836ed4fd
8 changed files with 29 additions and 29 deletions

View File

@@ -17,7 +17,7 @@ func init() {
})
}
type Storage struct {
type SQLiteStorage struct {
db *sql.DB
}
@@ -30,7 +30,7 @@ func SetNullable[T any](v *T) Nullable[T] {
return Nullable[T]{Set: true, Value: v}
}
func New(path string) (*Storage, error) {
func New(path string) (*SQLiteStorage, error) {
if pos := strings.IndexRune(path, '?'); pos == -1 {
params := "_journal=WAL&_sync=NORMAL&_busy_timeout=5000&cache=shared"
log.Printf("opening db with params: %s", params)
@@ -45,9 +45,9 @@ func New(path string) (*Storage, error) {
if err = migrate(db); err != nil {
return nil, err
}
return &Storage{db: db}, nil
return &SQLiteStorage{db: db}, nil
}
func (s *Storage) Close() error {
func (s *SQLiteStorage) Close() error {
return s.db.Close()
}