Skip to content
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 support for psycopg3 async #218

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

idumancic
Copy link
Contributor

@idumancic idumancic commented Dec 16, 2023

We have an architecture problem here aiopg implements cursor as coroutine but psycopg does not. I don't know how you want to handle this decision but that's why the fmt check fails because of the base class difference.

Let me know what you decide so I can implement, I don't want to do any major changes before you see it because it affects both CommandsAsync and AsynConnectionType public API.

Tests pass only because I am overriding the cursor method in Psycopg3CommandsAsync, but the typecheck fails as it should.

Copy link

codecov bot commented Dec 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (12f88f4) to head (3cfe43c).

❗ Current head 3cfe43c differs from pull request most recent head c2a2707. Consider uploading reports for the commit c2a2707 to get more accurate results

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #218   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines          582       595   +13     
  Branches       100       102    +2     
=========================================
+ Hits           582       595   +13     
Flag Coverage Δ
3.10-bigquery 71.26% <69.23%> (-0.05%) ⬇️
3.10-core 86.72% <69.23%> (-0.40%) ⬇️
3.10-mssql 72.10% <69.23%> (-0.07%) ⬇️
3.10-mysql 71.26% <69.23%> (-0.05%) ⬇️
3.10-oracle 72.10% <69.23%> (-0.07%) ⬇️
3.10-postgresql 87.22% <100.00%> (+0.97%) ⬆️
3.10-sqlite 70.92% <69.23%> (-0.04%) ⬇️
3.11-bigquery 71.26% <69.23%> (-0.05%) ⬇️
3.11-core 86.72% <69.23%> (-0.40%) ⬇️
3.11-mssql 72.10% <69.23%> (-0.07%) ⬇️
3.11-mysql 71.26% <69.23%> (-0.05%) ⬇️
3.11-oracle 72.10% <69.23%> (-0.07%) ⬇️
3.11-postgresql 87.22% <100.00%> (+0.97%) ⬆️
3.11-sqlite 70.92% <69.23%> (-0.04%) ⬇️
3.12-bigquery 71.26% <69.23%> (-0.05%) ⬇️
3.12-core 86.89% <69.23%> (-0.40%) ⬇️
3.12-mssql 72.10% <69.23%> (-0.07%) ⬇️
3.12-mysql 71.26% <69.23%> (-0.05%) ⬇️
3.12-oracle 72.10% <69.23%> (-0.07%) ⬇️
3.12-postgresql 87.39% <100.00%> (+0.96%) ⬆️
3.12-sqlite 70.92% <69.23%> (-0.04%) ⬇️
3.8-bigquery 71.33% <69.23%> (-0.05%) ⬇️
3.8-core 87.18% <69.23%> (-0.41%) ⬇️
3.8-mssql 72.17% <69.23%> (-0.07%) ⬇️
3.8-mysql 71.33% <69.23%> (-0.05%) ⬇️
3.8-oracle 72.17% <69.23%> (-0.07%) ⬇️
3.8-postgresql 87.35% <100.00%> (+0.97%) ⬆️
3.8-sqlite 70.99% <69.23%> (-0.04%) ⬇️
3.9-bigquery 71.33% <69.23%> (-0.05%) ⬇️
3.9-core 87.18% <69.23%> (-0.41%) ⬇️
3.9-mssql 72.17% <69.23%> (-0.07%) ⬇️
3.9-mysql 71.33% <69.23%> (-0.05%) ⬇️
3.9-oracle 72.17% <69.23%> (-0.07%) ⬇️
3.9-postgresql 87.35% <100.00%> (+0.97%) ⬆️
3.9-sqlite 70.99% <69.23%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@idumancic idumancic changed the title ✨ add support for psycopg3 async ✨ add support for psycopg3 async Dec 16, 2023
@zschumacher
Copy link
Owner

Seems like the cleanest thing might be wrapping the cursor in an awaitable for backwards compat, but I'm open to suggestions

@idumancic
Copy link
Contributor Author

Seems like the cleanest thing might be wrapping the cursor in an awaitable for backwards compat, but I'm open to suggestions

That was my thought also, to keep the API as it is and just wrap the cursor in awaitable since aiopg implements it by default. Would that have any consequences to psycopg if we go with that solution, can you think of anything?

@zschumacher
Copy link
Owner

hey sorry - been super busy. I think if we wrap it in an awaitable it will be completely fine. Is this still a feature you want to work on?

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

Successfully merging this pull request may close these issues.

2 participants