✨ 新增在线查漏补缺功能

This commit is contained in:
2025-06-29 01:45:24 +08:00
parent ca6a414ba4
commit c6f24bc3c2
72 changed files with 807 additions and 208 deletions
+9 -4
View File
@@ -1,7 +1,7 @@
import os
import re
from contextlib import asynccontextmanager
import os
from pathlib import Path
import re
import aiosqlite
@@ -103,9 +103,14 @@ class CSqlManager:
commonCols = [k for k in desired if k in existing]
if commonCols:
colsStr = ", ".join(f'"{c}"' for c in commonCols)
await cls.m_pDB.execute(
f'INSERT INTO "{tmpTable}" ({colsStr}) SELECT {colsStr} FROM "{tableName}";'
sql = (
f'INSERT INTO "{tmpTable}" ({colsStr}) '
f"SELECT {colsStr} "
f'FROM "{tableName}";'
)
await cls.m_pDB.execute(sql)
await cls.m_pDB.execute(f'DROP TABLE "{tableName}";')
await cls.m_pDB.execute(
f'ALTER TABLE "{tmpTable}" RENAME TO "{tableName}";'