🎨 fix(db): 数据库更新优化

This commit is contained in:
BTMuli
2023-04-25 20:23:30 +08:00
parent 96018666c5
commit 89d2e214bc
3 changed files with 29 additions and 6 deletions

View File

@@ -53,6 +53,21 @@ class TGSqlite {
await db.close();
}
/**
* @description 已有数据表跟触发器不变的情况下,更新数据库数据
* @memberof TGSqlite
* @since Alpha v0.1.4
* @returns {Promise<void>}
*/
public async update (): Promise<void> {
const db = await Database.load(this.dbPath);
const sqlD = await initSQLiteData();
for (const item of sqlD) {
await db.execute(item);
}
await db.close();
}
/**
* @description 检测数据库完整性
* @memberof TGSqlite