From c08e60da85215a9f6f3ccf802653acc62401f716 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Mon, 9 Oct 2023 15:02:04 +0200 Subject: [PATCH] use streaming when reading results --- nominatim/tools/convert_sqlite.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nominatim/tools/convert_sqlite.py b/nominatim/tools/convert_sqlite.py index 59c8e7687f..758fb7b254 100644 --- a/nominatim/tools/convert_sqlite.py +++ b/nominatim/tools/convert_sqlite.py @@ -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']