Skip to content
This repository was archived by the owner on Aug 19, 2025. It is now read-only.

allow iterate over custom num of records #473

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Mng-dev-ai
Copy link
Contributor

Closes #413

@@ -179,7 +179,7 @@ async def execute_many(self, queries: typing.List[ClauseElement]) -> None:
cursor.close()

async def iterate(
self, query: ClauseElement
self, query: ClauseElement, n: int = None
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n: Optional[int] = None

@@ -195,6 +195,10 @@ async def iterate(
Row._default_key_style,
row,
)
if n is not None:
n -= 1
if n == 0:
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe use if n <= 0 in case if negative n was passed

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature request: iterate over more than 1 record
2 participants