Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alt_python_pydbc_oracle-1.0.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

alt_python_pydbc_oracle-1.0.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file alt_python_pydbc_oracle-1.0.0.tar.gz.

File metadata

  • Download URL: alt_python_pydbc_oracle-1.0.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

Hashes for alt_python_pydbc_oracle-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9e9a625acbd6756981c9aa54988e36cd125dcc846d587f555d30e55e59402f41
MD5 60646a0b4b1d4d8f849894e28566955f
BLAKE2b-256 f6ffee82a3d125ad67218c45359198974b51ba5f86ca470bd5dc8723c864bc4d

See more details on using hashes here.

File details

Details for the file alt_python_pydbc_oracle-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: alt_python_pydbc_oracle-1.0.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

Hashes for alt_python_pydbc_oracle-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34a289f4f0f13926f866c9c931c2bf4cb76b268d8dc84c3ef1001960eef96afd
MD5 feb5f174d1f70295cb0f889b2bd45bba
BLAKE2b-256 86c488fc98c274d45795cd88b68246ba8108447415c5aef964cdbfaed248f0bd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page