pydbc driver for Oracle Database — wraps python-oracledb (thin mode)
Project description
alt-python-pydbc-oracle
pydbc driver for Oracle Database via python-oracledb (thin mode).
Installation
uv add alt-python-pydbc-oracle
URL format
pydbc:oracle://user:password@host:port/service_name
The port defaults to 1521 if omitted.
Usage
import pydbc_oracle # registers OracleDriver with DriverManager
from pydbc_core import DriverManager
conn = DriverManager.get_connection(
"pydbc:oracle://system:password@localhost:1521/FREEPDB1"
)
stmt = conn.create_statement()
rs = stmt.execute_query("SELECT 1 FROM dual")
print(rs.rows)
conn.close()
Parameterised queries
# Positional parameters (translated to :1, :2 numerics)
ps = conn.prepare_statement("SELECT * FROM users WHERE id = ?")
ps.set_int(1, 42)
rs = ps.execute_query()
# Named parameters (translated to :1, :2 numerics)
ps = conn.prepare_statement("SELECT * FROM users WHERE id = :id")
ps.set_int(1, 42)
rs = ps.execute_query()
Paramstyle note
python-oracledb uses named paramstyle internally (:name placeholders), but pydbc
forces numeric (:1, :2) for this driver because the ParamstyleNormalizer
handles both ? and :name inputs and produces numeric output that oracledb accepts.
Documentation
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alt_python_pydbc_oracle-1.1.0.tar.gz.
File metadata
- Download URL: alt_python_pydbc_oracle-1.1.0.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09265c481dc843e1551b186de36321765b0147e87878685be6953bfe0ca37ca4
|
|
| MD5 |
78ddfeb6d194415972e92c8c12fbdbd1
|
|
| BLAKE2b-256 |
69888570c2f3490225691dc206d6c6af1eb845bc4c8e22b28e2a04d96fb9ec62
|
File details
Details for the file alt_python_pydbc_oracle-1.1.0-py3-none-any.whl.
File metadata
- Download URL: alt_python_pydbc_oracle-1.1.0-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ea4765fffb5967474ac4b397db250179b9c4cc42328308298344465a0a5ab25
|
|
| MD5 |
034c5962dd04af24b5784c1ba656f1e4
|
|
| BLAKE2b-256 |
1fb2cfa3b322e446b850c60bd810723755a1f67f5551e41d87e22afb93d39179
|