mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 21:30:17 +08:00
c3f2f0798d
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
12 lines
218 B
Rust
12 lines
218 B
Rust
//! 数据访问对象 (DAO) 模块
|
|
//!
|
|
//! 提供各类数据的 CRUD 操作。
|
|
|
|
mod mcp;
|
|
mod prompts;
|
|
mod providers;
|
|
mod settings;
|
|
mod skills;
|
|
|
|
// 所有 DAO 方法都通过 Database impl 提供,无需单独导出
|