Metadata-Version: 2.4
Name: our-db
Version: 0.1.0
Summary: Database connectivity and configuration brick
Project-URL: Homepage, https://github.com/ourochronos/our-db
Project-URL: Repository, https://github.com/ourochronos/our-db
Author: Chris Jacobs
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.11
Requires-Dist: psycopg2-binary>=2.9
Requires-Dist: pydantic-settings>=2.0.0
Provides-Extra: async
Requires-Dist: asyncpg>=0.29.0; extra == 'async'
Provides-Extra: dev
Requires-Dist: mypy>=1.10; extra == 'dev'
Requires-Dist: pre-commit>=3.7; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.23; extra == 'dev'
Requires-Dist: pytest-cov>=4.0; extra == 'dev'
Requires-Dist: pytest-mock>=3.12; extra == 'dev'
Requires-Dist: pytest>=8.0; extra == 'dev'
Requires-Dist: ruff>=0.4; extra == 'dev'
Description-Content-Type: text/markdown

# our-db

Database connectivity, configuration, and migration brick. Part of the [ourochronos](https://github.com/ourochronos) ecosystem.

## Installation

```bash
pip install our-db

# With async support
pip install our-db[async]
```

## Usage

```python
from our_db import get_cursor, get_config

# Database access
with get_cursor() as cur:
    cur.execute("SELECT * FROM my_table")
    rows = cur.fetchall()

# Configuration
config = get_config()
print(config.db_host, config.db_port)
```

### Async

```python
from our_db import async_cursor

async with async_cursor() as conn:
    rows = await conn.fetch("SELECT * FROM my_table")
```

### Migrations

```python
from our_db import MigrationRunner

runner = MigrationRunner(migrations_dir="./migrations")
runner.up()        # Apply pending
runner.status()    # Check status
```

## Development

```bash
make dev    # Install with dev dependencies
make test   # Run tests
make lint   # Run linters
```
