-
-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add libpq interface for pipeline mode #89
Conversation
Hello, thank you for looking into this. I think it would be an amazing feature to provide. As a first MR, please feel free to propose one only adding the |
Ok, sounds good. |
I think having a test in the CI is important but maybe let's have a few jobs with libpq 14 and a few with whatever the system throws in. Adding a few comments to the MR... |
tests/pq/test_pipeline.py
Outdated
import psycopg | ||
from psycopg import pq | ||
|
||
pytestmark = pytest.mark.libpq(">= 14") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add tests to verify that on libpq < 14 the functions raise the expected exception? Thank you
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Bindings are conditional so that compilation works with libpq version older than 14. Add a couple of tests inspired by PostgreSQL's tests.
We add "libpq" matrix axis and select version 14 against various server versions.
First step towards #74 adding libpq bindings and extending CI checks with libpq 14.
Next working on implementing a Python interface; as a first (simple) draft, I was thinking of something like:
If I understand correctly, we need to keep track of cursors executing queries during a pipeline session and process their result when asked; which mean
fetch*()
methods would emitPQgetResult
calls (instead ofexecute()
currently). Since multiple cursors might be involved, we need a queue of active cursors to later bind pipeline results to their respective cursor.