oracle / python-oracledb

Python driver for Oracle Database conforming to the Python DB API 2.0 specification. This is the renamed, new major release of cx_Oracle
https://oracle.github.io/python-oracledb
Other
339 stars 67 forks source link

Support for asyncio #6

Closed anthony-tuininga closed 11 months ago

anthony-tuininga commented 2 years ago

This is a continuation of the original request made on cx_Oracle: https://github.com/oracle/python-cx_Oracle/issues/178.

The current status is that with the addition of the thin driver, adding suport for asyncio will be considerably simpler (and will only work in thin mode). If anyone has suggestions or recommendations on API, please share them!

cjbj commented 11 months ago

There's a chance :) Let me sync with Anthony - unless he does it before my day starts tomorrow.

syniex commented 11 months ago

There's a chance :) Let me sync with Anthony - unless he does it before my day starts tomorrow.

I hope you will async with Anthony ;)

anthony-tuininga commented 11 months ago

@syniex, we discussed this and agreed that we will release version 2.0 with asyncio support as it currently stands (probably some time next week). The feedback that has been received so far has all been positive. We will include a note that the asyncio support is under review and subject to change based on feedback after use in the real world! :-) That allows us to get out the other enhancements and bug fixes at the same time. So stay tuned!

anthony-tuininga commented 11 months ago

Asyncio support is now in main in preparation for the release of version 2.0.

anthony-tuininga commented 11 months ago

And version 2.0.0 has now been released! Thanks for your patience and let us know if you find anything that needs to be changed with the asyncio support.

cjbj commented 11 months ago

Yay.

FWIW I did a quick blog post here.

WilliamStam commented 10 months ago

so finally getting round to performance stuff in my projects. interestingly the oracledb async is marginly faster than the sync every single time i ran the stupid thrown together benchmark script (a few ms but still.. its consistently "faster"

(i was testing the execute part here not the connection / whatever else parts. and tried to do apples vs apples. im aware of connection.execute() but i felt that would be "unfair" to the sync part)

https://gist.github.com/WilliamStam/b9bed409e3a754bf05accb95d04bb54e

also.. ps.. &^@#$*&^ sqlalchemy :(

anthony-tuininga commented 10 months ago

Thanks for sharing! Is the "swearing" at SQLAlchemy because of performance or something else?

WilliamStam commented 10 months ago

lol yeah. having issues with SA and oracle but nothing for this thread

https://github.com/sqlalchemy/sqlalchemy/discussions/10874