Metadata-Version: 2.4
Name: alt-python-pydbc-oracle
Version: 1.0.0
Summary: pydbc driver for Oracle Database — wraps python-oracledb (thin mode)
Project-URL: Homepage, https://github.com/alt-python/pydbc
Project-URL: Repository, https://github.com/alt-python/pydbc
Project-URL: Documentation, https://github.com/alt-python/pydbc/blob/main/docs/getting-started.md
Project-URL: Bug Tracker, https://github.com/alt-python/pydbc/issues
Author: Craig Parravicini, Claude (Anthropic)
License-Expression: MIT
License-File: LICENSE
Keywords: database,db-api,jdbc,oracle,oracledb,sql
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Database
Classifier: Topic :: Database :: Front-Ends
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.12
Requires-Dist: alt-python-pydbc-core
Requires-Dist: oracledb>=2.0
Description-Content-Type: text/markdown

# alt-python-pydbc-oracle

pydbc driver for Oracle Database via [python-oracledb](https://python-oracledb.readthedocs.io/) (thin mode).

---

## Installation

```bash
uv add alt-python-pydbc-oracle
```

---

## URL format

```
pydbc:oracle://user:password@host:port/service_name
```

The port defaults to `1521` if omitted.

---

## Usage

```python
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

```python
# 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

- [Getting started tutorial](https://github.com/alt-python/pydbc/blob/main/docs/getting-started.md)
- [Core API reference](https://github.com/alt-python/pydbc/blob/main/docs/api-reference.md)

---

## License

MIT
