A huge year of growth for python-oracledb
It’s been three years since our ground-breaking python-oracledb driver replaced the venerable cx_Oracle driver, and a year since I gave a status update. This post reviews the features and achievements of python-oracledb over the last year.
Last year I wrote a post A Celebration of Python and Oracle Database which covered the history of the python-oracledb driver in its first two years since it replaced cx_Oracle. It’s time to bring you up to date.
WHAT’S NEW SINCE 2024
Python use over the last year has grown rapidly, and the additional features of python-oracledb continue to be attractive to Oracle Database developers, particularly in the AI and data analysis fields. In the few months so far since our 3.0 release, the number of daily python-oracledb downloads has doubled.
The major trends for python-oracledb over the year have been support for Oracle Database 23ai and Oracle Cloud features, and improvements to python-oracledb Thin mode (the default mode without Oracle Client libraries) for parity with Thick mode.
Highlights are listed below.
python-oracledb 2.3.0
Python-oracledb 2.3 was released in July 2024. Oracle Database 23.5 had just introduced a BINARY
format for the VECTOR
data type, so support was added to the driver. Two-Phase Commit and BFILE
data type support landed in Thin mode (to match Thick mode). A new ssl_version
parameter lets TCPS connections choose a TLS version. There was a new ping_timeout
option for connection pooling to improve reliability. Smaller binaries shipped on Linux: they were small already but we changed to use the gcc -g0
compiler option to make them even tinier. An overall review of Oracle Database’s driver defaults occurred and this lead to the defaults for tcp_connection_timeout
and retry_delay
to change, giving consistent user experience and good default behavior across all languages.
See the release announcement and release notes.
python-oracledb 2.4.0
Support for Oracle Database 23ai Pipelining landed. I love this feature and blogged about it several times, e.g. Pipelined database operation performance redux with python-oracledb: very impressive. The release also had the start of connection management refactoring with a reworked connection string parser. We have to keep up with the Python community so we added binary packages for Python 3.13, and dropped Python 3.7.
See the release announcement and release notes.
python-oracledb 2.5.0
LDAP support in Thin mode was a highly requested feature: a register_protocol()
function was added so you can easily use your favorite Python LDAP package. There were improvements to Pipelining with the addition of warnings, and access to column metadata for pipelined queries. A database size attribute max_identifier_length
was introduced to make frameworks like SQLAlchemy more efficient (by avoiding the need for them to execute a full query to find the length). Attributes program
, terminal
, machine
, osuser
, driver_name
can be set in Thin mode and queried in Oracle Database V$ tables. Thin mode users can now set appcontext
and edition
during connection (bringing Thin mode in line with Thick mode). Locale aware config_dir
and lib_dir
path handling changes aid some Windows users. Binary packages are now built using a GitHub action, making builds easier, and giving us a way to create development packages for you to test throughout a release cycle.
See the release announcement and release notes.
python-oracledb 3.0.0
This was a big release with a lot changing around connection management. There were also two marquee features: Data Frames (for Thin and Thick modes), and AQ support in Thin mode. Altogether the major version bump was deserved.
Data frame support has been a “big deal”, allowing faster and easier access to data for users of popular Python analysis libraries. Check out some of my blog posts, starting with Going 10x faster with python-oracledb Data Frames.
Oracle Database’s Advanced Queueing support in Thin mode was a highly requested feature, and Oracle’s AQ team contributed RAW and ADT payload support.
Oracle Database 23.7 introduced a “sparse” VECTOR
data type. Python-oracledb 3.0 added support for it.
On the connection side, there were new plugins and hooks; support for Configuration Providers to centralize connection management; support for Cloud Native Authentication; named connection pools; improved Thin mode address list load balancing and failover; Transaction Guard support (in Thin mode to match Thick mode).
See the release announcement and release notes.
python-oracledb 3.1.0
More work from Oracle’s AQ team to bring driver mode parity saw support for JSON payloads and for bulk operations added to Thin mode. AQ support was also added for asyncio users. Data frame improvements included support for additional database data types. Scrollable Cursor support in Thin mode brings parity with Thick mode. We dropped support for Python 3.8, which the Python community had already dropped last year.
See the release announcement and release notes.
Frameworks, ORMs, SQL Generators, and Libraries
Just as critical to the success of python-oracledb has been its use in frameworks, ORMs, SQL generators, and libraries (did I miss any category?) The trend away from cx_Oracle to support python-oracledb continued, and we thank the user community for their efforts. Two big contributions from our driver team also landed: VECTOR
support in SQLAlchemy 2.0.41, and connection pooling in Django 5.2.
What’s next?
It’s only been a few weeks since our 3.1 release but features are already rolling into GitHub for the future 3.2 bundle. As of writing, I can see AQ support for Recipient Lists in Thin mode, and support for Instance Principal authentication merged. Data Frame support for VECTOR
is close. And there will be more!
Thanks to you all for using python-oracledb and helping make it a great success.
Python-oracledb Resources
Python-oracledb is an open source package for the Python Database API specification with many additions to support advanced Oracle Database features. By default, it is a ‘Thin’ driver that is immediately usable without needing any additional install e.g. no Instant Client is required. Python-oracledb is used by frameworks, ORMs, SQL generation libraries, and other projects.