Compare commits

...
Sign in to create a new pull request.

1 commit

View file

@ -396,23 +396,7 @@ class SQLAlchemyAdapter:
rows = result.mappings().all() rows = result.mappings().all()
return rows return rows
async def execute_query(self, query): # The unsafe execute_query method has been removed due to SQL injection risk.
"""
Execute a raw SQL query against the database asynchronously.
Parameters:
-----------
- query: The SQL query string to execute.
Returns:
--------
The result set as a list of dictionaries, with each dictionary representing a row.
"""
async with self.engine.begin() as connection:
result = await connection.execute(text(query))
return [dict(row) for row in result]
async def drop_tables(self): async def drop_tables(self):
""" """