if parent_place_id is not None:
sql = sql.where(t.c.parent_place_id == parent_place_id)
- inner = sql.subquery()
+ inner = sql.subquery('ipol')
sql = sa.select(inner.c.place_id, inner.c.osm_id,
inner.c.parent_place_id, inner.c.address,
inner.c.distance)
if self.has_geometries():
- sub = sql.subquery()
- sql = self._add_geometry_columns(sql, sub.c.centroid)
+ sub = sql.subquery('geom')
+ sql = self._add_geometry_columns(sa.select(sub), sub.c.centroid)
return (await self.conn.execute(sql)).one_or_none()
.where(t.c.parent_place_id == parent_place_id)\
.order_by('distance')\
.limit(1)\
- .subquery()
+ .subquery('tiger')
sql = sa.select(inner.c.place_id,
inner.c.parent_place_id,
inner.c.distance)
if self.has_geometries():
- sub = sql.subquery()
- sql = self._add_geometry_columns(sql, sub.c.centroid)
+ sub = sql.subquery('geom')
+ sql = self._add_geometry_columns(sa.select(sub), sub.c.centroid)
return (await self.conn.execute(sql)).one_or_none()
.where(t.c.type != 'postcode')\
.order_by(sa.desc(t.c.rank_search))\
.limit(50)\
- .subquery()
+ .subquery('area')
sql = _select_from_placex(inner)\
.where(inner.c.geometry.ST_Contains(wkt))\
.intersects(wkt))\
.order_by(sa.desc(t.c.rank_search))\
.limit(50)\
- .subquery()
+ .subquery('places')
touter = self.conn.t.placex.alias('outer')
sql = _select_from_placex(inner)\
result.distance = row.distance
if hasattr(row, 'bbox'):
result.bbox = Bbox.from_wkb(row.bbox.data)
- await nres.add_result_details(self.conn, result, self.params)
+ await nres.add_result_details(self.conn, [result], self.params)
return result