X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/5c55c1d8a15f525bf1c4a17aedbd6f960ad9d3b6..5184a8aff9686c4035e236be65c3615fe97859a0:/nominatim/api/connection.py?ds=sidebyside 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)