🧪 剧诗表检测

This commit is contained in:
目棃
2024-11-11 17:58:20 +08:00
parent da4a095618
commit d88e1d1429
2 changed files with 24 additions and 0 deletions

View File

@@ -12,6 +12,23 @@ import { timestampToDate } from "../../../utils/toolFunc.js";
import TGSqlite from "../index.js";
import { transUserCombat } from "../utils/transUserCombat.js";
/**
* @description 数据表检测
* @since Beta v0.6.3
* @todo 版更后移除,该方法仅用于测试版过渡
* @return {Promise<boolean>}
*/
async function check(): Promise<boolean> {
const db = await TGSqlite.getDB();
try {
await db.select("SELECT DISTINCT uid FROM RoleCombat;");
return true;
} catch (e) {
console.log(e);
return false;
}
}
/**
* @description 直接插入数据
* @since Beta v0.6.3
@@ -148,6 +165,7 @@ async function restoreCombat(dir: string): Promise<boolean> {
}
const TSUserCombat = {
check,
getAllUid,
getCombat,
saveCombat,