Files
cc-switch/src-tauri
T
Jason c3f2f0798d refactor(database): split monolithic database.rs into modular structure
Split the 1788-line database.rs into a well-organized module directory:

- mod.rs (142 lines): Database struct and initialization
- schema.rs (341 lines): Table creation and schema migrations
- backup.rs (324 lines): SQL import/export and snapshot backup
- migration.rs (240 lines): JSON to SQLite data migration
- tests.rs (280 lines): Unit tests
- dao/providers.rs (254 lines): Provider CRUD operations
- dao/mcp.rs (97 lines): MCP server CRUD operations
- dao/prompts.rs (88 lines): Prompt CRUD operations
- dao/skills.rs (124 lines): Skills CRUD operations
- dao/settings.rs (65 lines): Settings key-value storage

Benefits:
- Max file size reduced from 1788 to 341 lines
- Clear separation of concerns (schema, backup, migration, DAOs)
- Easier to navigate and maintain
- All 107 tests passing with zero API changes
c3f2f0798d ยท 2025-11-25 11:56:08 +08:00
History
..
2025-11-22 19:18:35 +08:00
2025-11-24 11:00:45 +08:00
2025-11-24 11:00:45 +08:00
2025-11-22 19:18:35 +08:00