Skip to content

Commit

Permalink
use streaming when reading results
Browse files Browse the repository at this point in the history
  • Loading branch information
lonvia committed Oct 9, 2023
1 parent f2e5cad commit c08e60d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nominatim/tools/convert_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ async def copy_data(self) -> None:
if isinstance(c.type, Geometry) else c
for c in self.inconn.t.meta.tables[table.name].c]
data = []
for row in await self.inconn.execute(sa.select(*columns)):
async_result = await self.inconn.connection.stream(sa.select(*columns))
async for row in async_result:
params = row._asdict()
if 'class' in params:
params['class_'] = params['class']
Expand Down

0 comments on commit c08e60d

Please sign in to comment.