pythonoracledb 已率先支持 Oracle 23ai
python-oracledb 介绍
python-oracledb (以下简称 oracledb) 是 Python cx_Oracle 驱动程序的新名称。 oracledb 驱动程序是一个开源模块,使 Python 程序能够访问 Oracle 数据库。
该模块目前在 Python 3.7 到 3.12上,针对 Oracle 数据库 23ai, 21c, 19c, 18c, 12c 和 11gR2 进行了测试。
oracledb 最新版本为 2.2.0,以支持 23ai 的如下特性:
- 支持 VECTOR 数据类型。
- 支持隐式连接池,DRCP (数据库驻留连接池) 和 PRCP (代理驻留连接池),通过新参数
pool_boundary
启用。 - 为从 OCI 云网络连接到 Oracle Autonomous Database Serverless (ADB-S) 的应用程序添加了对 TCP Fast Open 的支持,通过新的
use_tcp_fast_open
参数启用。 - 增加了 oracledb.JsonId 类,以表示存储在本机集合中的文档的
_id
属性中由 SODA 返回的 JSON ID 值。 - 增加了对 23ai JSON 功能的支持,并允许字段名称具有超过 255 个 UTF-8 编码字节。
- 增加了 SQL 域的属性
FetchInfo.domain_schema
、FetchInfo.domain_name
和FetchInfo.annotations
以及与要获取的列关联的注释。
python-oracledb 安装
准备 Python 环境,这里使用的是 Python 3.9。
$ python --version
Python 3.9.18