MagicStack / MagicStack/asyncpg
Custom CursorIterator
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 8.1k
- Forks
- 468
- PR merge metrics
- No merged PRs in 30d
Description
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__
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Trace CursorFactory and the PreparedStatement.cursor and PreparedStatement.__init__ entry points to understand how a custom CursorIterator could be exposed through the public interface. Decide which proposed hook fits the existing API, then verify that callers can supply a custom iterator while the default behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- postgresql, python
- Domain
- api, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100