import sqlite3, os ROOT = r"F:\水利智学系统\可运行版(解压即用,双击start.bat)" db = os.path.join(ROOT, "backend", "data", "shuili_exam.db") c = sqlite3.connect(db) cur = c.cursor() for t in ["cache_invalidation", "conversation_log"]: try: n = cur.execute(f"SELECT COUNT(*) FROM {t}").fetchone()[0] print(f"TABLE {t}: rows={n}") except Exception as e: print(f"TABLE {t}: ERROR {e}") # list all tables count print("--- total tables ---") print(cur.execute("SELECT COUNT(*) FROM sqlite_master WHERE type='table'").fetchone()[0]) # rag tables print("--- rag-related tables ---") for r in cur.execute("SELECT name FROM sqlite_master WHERE type='table' AND (name LIKE '%rag%' OR name LIKE '%knowledge%' OR name LIKE '%graph%')").fetchall(): print(r[0])