mirror of
https://github.com/nkanaev/yarr.git
synced 2026-06-24 17:15:17 +00:00
rename Storage struct to SQLiteStorage
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user