refactor: 收口 V3 分层架构与插件兼容边界

This commit is contained in:
jxxghp
2026-08-18 13:22:02 +08:00
parent cca99bd421
commit 8472bcff43
274 changed files with 10730 additions and 6130 deletions
+17
View File
@@ -0,0 +1,17 @@
"""数据库技术边界的连通性探测实现。"""
from sqlalchemy import text
from app.db.session import SessionFactory
def probe_database() -> str | None:
"""执行最小数据库查询,成功返回空值,失败返回错误文本。"""
session = SessionFactory()
try:
session.execute(text("SELECT 1"))
except Exception as err: # noqa: BLE001 探测需要把驱动错误转为诊断文本
return str(err)
finally:
session.close()
return None