重新按英文命名,修改成相对路径

This commit is contained in:
lianjianwei2024
2026-10-11 10:52:01 +08:00
parent eea5d511dc
commit 9bb23ac13b
64 changed files with 913 additions and 1427 deletions

25
release/testdata/probe_db.py vendored Normal file
View File

@@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
"""最小探针:定位哪个库、哪种打开方式能读。只读 SELECT。"""
import glob
import sqlite3
import sys
sys.stdout.reconfigure(errors="replace")
base = glob.glob("D:/Pricing review*/\u9020\u4ef7\u5ba1\u6838/data")[0]
targets = {
"history.db(真实)": base + "/history.db",
"history-test.db": base + "/history-test.db",
"session.db(真实)": base + "/session.db",
"session-test.db": base + "/session-test.db",
}
for name, p in targets.items():
for mode, uri in (("普通", False), ("ro", True)):
try:
con = sqlite3.connect(p if not uri else "file:" + p.replace("\\", "/") + "?mode=ro", uri=uri, timeout=5)
n = con.execute("SELECT COUNT(*) FROM sqlite_master").fetchone()[0]
con.close()
print("%-18s %-4s OK, sqlite_master=%d" % (name, mode, n))
break
except Exception as e:
print("%-18s %-4s FAIL: %s" % (name, mode, e))