You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to implement my own CursorIterator, but I can't find a straightforward way of getting it done via asyncpg public interface.
Currently it's created by CursorFactory, which in turn is created by PreparedStatement.cursor.
I can see two options here:
Introduce an additional parameter of CursorFactory type in PreparedStatement.cursor which would be None by default and None means use standard CursorFactory
do the same in PreparedStatement.init
The text was updated successfully, but these errors were encountered:
It's not possible to use it as is given that current iterator fetches rows in batches, but yields individual rows.
So what I ended up doing is implemented an iterator that yields batches (it's basically a copy of CursorIterator), wrapped it into an iter_fast and then wrapped it one more time into an iterator that flattens batches into individual rows:
I'd like to implement my own CursorIterator, but I can't find a straightforward way of getting it done via asyncpg public interface.
Currently it's created by CursorFactory, which in turn is created by PreparedStatement.cursor.
I can see two options here:
The text was updated successfully, but these errors were encountered: