🚨 修复 qodana 报错

This commit is contained in:
BTMuli
2024-01-03 22:20:50 +08:00
parent 67e7dabdc6
commit 6096157507
2 changed files with 9 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
/**
* @file plugins/Sqlite/index.ts
* @description Sqlite 数据库操作类
* @since Beta v0.3.9
* @since Beta v0.4.0
*/
import { app } from "@tauri-apps/api";
@@ -186,15 +186,17 @@ class Sqlite {
/**
* @description 重置数据库
* @since Beta v0.3.3
* @since Beta v0.4.0
* @returns {Promise<void>}
*/
public async reset(): Promise<void> {
const db = await this.getDB();
this.tables.map(async (item) => {
const sql = `DROP TABLE IF EXISTS ${item};`;
await db.execute(sql);
});
await Promise.all(
this.tables.map(async (item) => {
const sql = `DROP TABLE IF EXISTS ${item};`;
await db.execute(sql);
}),
);
await this.initDB();
}