X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/a413aae8a3962be4d623844d867604df68a9a211..b710297d053fe0bfd8fb23686b48358853dbd827:/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))