mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2025-12-13 09:28:14 +08:00
♻️ 代码结构调整
This commit is contained in:
@@ -174,22 +174,6 @@ class Sqlite {
|
||||
);
|
||||
await this.initDB();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 检测特定表是否存在
|
||||
* @since Beta v0.4.5
|
||||
* @param {string} table 表名
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async checkTableExist(table: string): Promise<boolean> {
|
||||
const db = await this.getDB();
|
||||
const sql = `SELECT name
|
||||
FROM sqlite_master
|
||||
WHERE type = 'table'
|
||||
AND name = '${table}';`;
|
||||
const res: Array<{ name: string }> = await db.select(sql);
|
||||
return res.length > 0;
|
||||
}
|
||||
}
|
||||
|
||||
const TGSqlite = new Sqlite();
|
||||
|
||||
Reference in New Issue
Block a user