refactor(backend): migrate import/export to use SQL backup

- Reimplement export_config_to_file to use database.export_sql
- Reimplement import_config_from_file to use database.import_sql
- Add sync_current_from_db to sync live configs after import
- Add settings database binding on app initialization
- Remove deprecated JSON-based config import logic
This commit is contained in:
YoVinchen
2025-11-24 00:46:00 +08:00
parent 6443dc897d
commit fd25c9949f
3 changed files with 67 additions and 55 deletions
+1
View File
@@ -570,6 +570,7 @@ pub fn run() {
}
}
crate::settings::bind_db(db.clone());
let app_state = AppState::new(db);
// 检查是否需要首次导入(数据库为空)