X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/16b6484c650eef161e64153f748643ca61553753..7284689b500e2af43692983cf07d4b3d2649e02b:/nominatim/api/connection.py diff --git a/nominatim/api/connection.py b/nominatim/api/connection.py index 79a5e347..efa4490e 100644 --- a/nominatim/api/connection.py +++ b/nominatim/api/connection.py @@ -13,6 +13,7 @@ import sqlalchemy as sa from sqlalchemy.ext.asyncio import AsyncConnection from nominatim.db.sqlalchemy_schema import SearchTables +from nominatim.api.logging import log class SearchConnection: """ An extended SQLAlchemy connection class, that also contains @@ -34,14 +35,16 @@ class SearchConnection: ) -> Any: """ Execute a 'scalar()' query on the connection. """ + log().sql(self.connection, sql) return await self.connection.scalar(sql, params) - async def execute(self, sql: sa.sql.base.Executable, + async def execute(self, sql: 'sa.Executable', params: Union[Mapping[str, Any], Sequence[Mapping[str, Any]], None] = None - ) -> 'sa.engine.Result[Any]': + ) -> 'sa.Result[Any]': """ Execute a 'execute()' query on the connection. """ + log().sql(self.connection, sql) return await self.connection.execute(sql, params)