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

python-oracledb support for asyncio #258

Closed
anthony-tuininga opened this issue Nov 22, 2023 · 1 comment
Closed

python-oracledb support for asyncio #258

anthony-tuininga opened this issue Nov 22, 2023 · 1 comment

Comments

@anthony-tuininga
Copy link
Member

anthony-tuininga commented Nov 22, 2023

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() and create_pool_async(). There are also new class names
AsyncConnectionPool, AsyncCursor, AsyncConnection, and AsyncLOB.

You can build the driver using the steps in Installing from Source Code:

git clone --recurse-submodules https://github.com/oracle/python-oracledb.git
cd python-oracledb
git checkout asyncio-support
python setup.py build
python setup.py install

One open question is whether we should simplify statement execution and remove explicit cursor usage. Instead the driver could have connection.execute() or perhaps connection.fetchone/many/all() calls. But this would need some new alternative to cursor.var() etc.

Some tasks to be done:

@oracle oracle locked as resolved and limited conversation to collaborators Nov 22, 2023
@cjbj cjbj pinned this issue Nov 26, 2023
@cjbj cjbj changed the title Support for asyncio python-oracledb support for asyncio Dec 3, 2023
@cjbj
Copy link
Member

cjbj commented Dec 19, 2023

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

@cjbj cjbj closed this as completed Dec 20, 2023
@cjbj cjbj unpinned this issue Dec 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants