- Configure SQLite with Write-Ahead Logging (WAL) mode for better concurrency.
- Set connection pool settings to optimize database access.
- Execute additional PRAGMA statements for optimal performance.
- Update logging to reflect new database initialization details.
feat(clipboard): migrate clipboard data handling to new settings storage
- Implement migration of clipboard data from legacy JSON to new database-backed storage.
- Introduce methods for managing favorite clipboard items in settings.
- Update clipboard plugin to utilize new favorite management functions.
refactor(setting): improve error logging for settings retrieval
- Replace direct logger calls with `util.GetLogger()` for consistency across settings management.
- Introduced a new `Store` struct for managing Wox settings and plugin settings with GORM.
- Implemented migration logic to transfer settings from old JSON files to the new SQLite database.
- Updated the `Value` type to handle lazy loading and persistence of setting values.
- Refactored existing settings access in the UI and other components to utilize the new store.
- Added migration tests to ensure data integrity during the transition.
- Enhanced logging for better traceability during migration and settings updates.
Refactors the entire settings management system from JSON files to a more robust and scalable SQLite database using GORM. This architectural change lays the foundation for future features like cloud synchronization.
Key changes:
- Introduces a new `database` package with GORM models for all settings and app data.
- Implements a backward-compatible migration system that automatically moves existing users settings from `wox.setting.json` and `wox.app.data.json` to the new `wox.db` file on the first run.
- Moves the database location to `userDataDirectory` to align with the projects data storage conventions.
- Rewrites the `setting.Manager` to be fully database-driven, replacing all file I/O with GORM operations.
- Sacrifices `FavoriteResults` during migration due to the technical limitation of its one-way hash implementation.
This resolves the issue of having scattered JSON configuration and provides a centralized, transactional data store.