X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/dc99bbb0afb7632b5497d4f6f41acff5b2e635e2..c29ffc38e6cef4bb99fd40060be8243ea70e5939:/nominatim/api/connection.py diff --git a/nominatim/api/connection.py b/nominatim/api/connection.py index e157d062..72cabf78 100644 --- a/nominatim/api/connection.py +++ b/nominatim/api/connection.py @@ -10,11 +10,11 @@ Extended SQLAlchemy connection class that also includes access to the schema. from typing import cast, Any, Mapping, Sequence, Union, Dict, Optional, Set import sqlalchemy as sa -from geoalchemy2 import Geometry from sqlalchemy.ext.asyncio import AsyncConnection from nominatim.typing import SaFromClause from nominatim.db.sqlalchemy_schema import SearchTables +from nominatim.db.sqlalchemy_types import Geometry from nominatim.api.logging import log class SearchConnection: @@ -38,7 +38,7 @@ class SearchConnection: ) -> Any: """ Execute a 'scalar()' query on the connection. """ - log().sql(self.connection, sql) + log().sql(self.connection, sql, params) return await self.connection.scalar(sql, params) @@ -47,7 +47,7 @@ class SearchConnection: ) -> 'sa.Result[Any]': """ Execute a 'execute()' query on the connection. """ - log().sql(self.connection, sql) + log().sql(self.connection, sql, params) return await self.connection.execute(sql, params) @@ -112,4 +112,4 @@ class SearchConnection: return sa.Table(tablename, self.t.meta, sa.Column('place_id', sa.BigInteger), - sa.Column('centroid', Geometry(srid=4326, spatial_index=False))) + sa.Column('centroid', Geometry))