Files
cc-switch/src-tauri/src/store.rs
YoVinchen 529051f0e8 refactor(core): integrate SQLite database into application core
- Initialize database on app startup with migration from JSON config
- Update AppState to include Database instance alongside MultiAppConfig
- Simplify store module by removing unused session management code
- Add database initialization to app setup flow
- Support both database and legacy config during transition
2025-11-22 23:26:41 +08:00

15 lines
248 B
Rust

use crate::database::Database;
use std::sync::Arc;
/// 全局应用状态
pub struct AppState {
pub db: Arc<Database>,
}
impl AppState {
/// 创建新的应用状态
pub fn new(db: Arc<Database>) -> Self {
Self { db }
}
}