Commit Graph

3 Commits

Author SHA1 Message Date
qianlifeng 5be879167f
feat(database): enhance SQLite configuration for improved concurrency
- 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.
2025-07-17 22:53:01 +08:00
qianlifeng 405346cc09
refactor(setting): refactor settings management to use a unified store interface and migrate from JSON to SQLite database
- 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.
2025-07-17 13:53:14 +08:00
qianlifeng 247c970ed2
feat(setting): Refactor settings to use a database-backed store
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.
2025-07-15 21:47:52 +08:00