From 1384bdfc5b81789f8eb7600b543de5f8d26bf184 Mon Sep 17 00:00:00 2001 From: Yusur Princeps Date: Tue, 12 Aug 2025 21:38:58 +0200 Subject: [PATCH] support async iterator on AsyncSelectPagination --- src/suou/__init__.py | 2 +- src/suou/sqlalchemy_async.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/suou/__init__.py b/src/suou/__init__.py index 38ba718..d11ad6f 100644 --- a/src/suou/__init__.py +++ b/src/suou/__init__.py @@ -34,7 +34,7 @@ from .validators import matches from .redact import redact_url_password from .http import WantsContentType -__version__ = "0.5.0-dev31" +__version__ = "0.5.0-dev32" __all__ = ( 'ConfigOptions', 'ConfigParserConfigSource', 'ConfigSource', 'ConfigValue', diff --git a/src/suou/sqlalchemy_async.py b/src/suou/sqlalchemy_async.py index 6838329..99f0777 100644 --- a/src/suou/sqlalchemy_async.py +++ b/src/suou/sqlalchemy_async.py @@ -146,4 +146,9 @@ class AsyncSelectPagination(Pagination): self.total = await self._query_count() return self + async def __aiter__(self): + await self + for i in self.items: + yield i + __all__ = ('SQLAlchemy', ) \ No newline at end of file