From 2ae02d67fcd5a30eac8aca724620878d9df82e59 Mon Sep 17 00:00:00 2001 From: Josh Hayes <35790761+hayescode@users.noreply.github.com> Date: Tue, 8 Oct 2024 10:48:33 -0500 Subject: [PATCH] SQLAlchemy: properly quote identifier (#1395) Fixes #1394 which was introduced in #1319. --- backend/chainlit/data/sql_alchemy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/chainlit/data/sql_alchemy.py b/backend/chainlit/data/sql_alchemy.py index 0470a2e51b..f8ea7d7d52 100644 --- a/backend/chainlit/data/sql_alchemy.py +++ b/backend/chainlit/data/sql_alchemy.py @@ -155,7 +155,7 @@ async def _get_user_identifer_by_id(self, user_id: str) -> str: async def _get_user_id_by_thread(self, thread_id: str) -> Optional[str]: if self.show_logger: logger.info(f"SQLAlchemy: _get_user_id_by_thread, thread_id={thread_id}") - query = "SELECT userId FROM threads WHERE id = :thread_id" + query = """SELECT "userId" FROM threads WHERE id = :thread_id""" parameters = {"thread_id": thread_id} result = await self.execute_sql(query=query, parameters=parameters) if result: