From a557d4f76e3a2b703812c6885b234966fe880bc4 Mon Sep 17 00:00:00 2001 From: martsforever Date: Tue, 14 Oct 2025 17:48:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=89=A7=E8=A1=8Csql=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controller/test_connection.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/app/controller/test_connection.py b/app/controller/test_connection.py index 09a36c9..7559908 100644 --- a/app/controller/test_connection.py +++ b/app/controller/test_connection.py @@ -17,3 +17,15 @@ def add_test_connection_route(app: FastAPI): return { "result": list[0] if list else None } + + @app.get("/query_llm_user2") + async def query_llm_user(username: str, session: AsyncSessionDep): + result = await (await session.connection()).exec_driver_sql( + "select * from llm_user where username = %s", + tuple([username]) + ) + print("result", result) + list = [dict(row._mapping) for row in result] + return { + "result": list[0] if list else None + }