优化 / 高 / 前端组件
src/components/settings/SettingsModal.tsx
SettingsModal 中 inheritDatabase 复选框允许用户继承原工作空间数据库:
PRAGMA integrity_check
async function validateDatabase(dbPath: string): Promise<boolean> { const tempDb = new Database(dbPath, { readonly: true }); const result = tempDb.prepare('PRAGMA integrity_check').get() as { integrity_check: string }; tempDb.close(); return result.integrity_check === 'ok'; } if (inheritDatabase) { const isValid = await validateDatabase(sourceDbPath); if (!isValid) { showError('源数据库损坏,无法继承'); return; } // 执行继承 }
No dependencies set.
The note is not visible to the blocked user.
问题类型
优化 / 高 / 前端组件
文件位置
src/components/settings/SettingsModal.tsx问题描述
SettingsModal 中 inheritDatabase 复选框允许用户继承原工作空间数据库:
影响
建议修复
PRAGMA integrity_check