Closed anthony-tuininga closed 6 months ago
Python-oracledb 2.0 has been released with asyncio support. We are still denoting the new asyncio APIs as 'pre-release' to give us some leeway if you uncover things we can improve.
Release announcement blog post: https://cjones-oracle.medium.com/python-oracledb-2-0-has-asyncio-support-2b913e40f9ca
Good news! A prototype of python-oracledb asyncio support is on branch asyncio-support.
We are soliciting your feedback - please add comments to Issue #6.
The timeline for a production release is dependent on your testing and evaluation comments.
The new async API is part of the existing oracledb module. Any database call which needs a round-trip to the DB now has an async counterpart. (This means your code can choose whether to use the previous API or the new async API. We suggest applications in general don't use both at the same time!)
Only Thin mode supports asyncio. There are no plans to implement it in Thick mode. All DB versions that Thin mode connects to can be used, i.e. 12.1+.
Samples are in samples/*_async.py. Tests are in tests/*_async.py.
Note connection is via new methods
connect_async()
andcreate_pool_async()
. There are also new class namesAsyncConnectionPool
,AsyncCursor
,AsyncConnection
, andAsyncLOB
.You can build the driver using the steps in Installing from Source Code:
One open question is whether we should simplify statement execution and remove explicit cursor usage. Instead the driver could have
connection.execute()
or perhapsconnection.fetchone/many/all()
calls. But this would need some new alternative tocursor.var()
etc.Some tasks to be done:
Integration with SQLAlchemy Asynchronous I/O. Update: see https://github.com/sqlalchemy/sqlalchemy/issues/10679
Make use of Oracle Database 23c's updated network protocol to improve performance with bigger DB responses when connected to 23c.
Evaluate using Oracle Database 23c's new pipelining functionality.