From d4d2f588300fc98430fca0098e3ec87db2101bca Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 20 Aug 2025 12:10:52 +0000 Subject: [PATCH] Checkpoint before follow-up message Co-authored-by: jxxghp --- app/modules/postgresql/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/modules/postgresql/__init__.py b/app/modules/postgresql/__init__.py index cc2a28a5..ca5bffc3 100644 --- a/app/modules/postgresql/__init__.py +++ b/app/modules/postgresql/__init__.py @@ -4,6 +4,7 @@ from app.core.config import settings from app.db import SessionFactory from app.modules import _ModuleBase from app.schemas.types import ModuleType, OtherModulesType +from sqlalchemy import text class PostgreSQLModule(_ModuleBase): @@ -54,7 +55,7 @@ class PostgreSQLModule(_ModuleBase): # 测试数据库连接 db = SessionFactory() try: - db.execute("SELECT 1") + db.execute(text("SELECT 1")) except Exception as e: return False, f"PostgreSQL连接失败:{e}" finally: