Metadata-Version: 2.4
Name: turbopg
Version: 0.1.0rc1
Summary: Zig-native Postgres client for Python — zero-overhead queries powered by pg.zig
Author-email: Rach Pradhan <rach@turboapi.dev>
License: MIT
Project-URL: Homepage, https://github.com/justrach/turboAPI
Project-URL: Repository, https://github.com/justrach/turboAPI
Project-URL: Documentation, https://github.com/justrach/turboAPI#turbopg
Keywords: postgres,database,zig,performance,pg,sql,pool
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Database
Classifier: Topic :: Database :: Front-Ends
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Provides-Extra: psycopg2
Requires-Dist: psycopg2-binary>=2.9; extra == "psycopg2"
Provides-Extra: psycopg
Requires-Dist: psycopg>=3.1; extra == "psycopg"
Provides-Extra: turbo
Requires-Dist: turboapi>=1.0.0; extra == "turbo"
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: psycopg2-binary>=2.9; extra == "dev"

# TurboPG

Zig-native Postgres client for Python. Zero-overhead database operations powered by [pg.zig](https://github.com/justrach/pg.zig).

## Install

```bash
pip install turbopg
# With psycopg2 fallback:
pip install turbopg[psycopg2]
```

## Usage

```python
from turbopg import Database

db = Database("postgres://user:pass@localhost/mydb", pool_size=16)

# Query rows
users = db.query("SELECT * FROM users WHERE age > $1 LIMIT $2", [18, 10])

# Single row
user = db.query_one("SELECT * FROM users WHERE id = $1", [42])

# Execute (INSERT/UPDATE/DELETE)
db.execute("INSERT INTO users (name, email) VALUES ($1, $2)", ["Alice", "a@b.com"])
```

## With TurboAPI (zero-Python DB routes)

```python
from turboapi import TurboAPI

app = TurboAPI()
app.configure_db("postgres://...", pool_size=16)

@app.db_get("/users/{user_id}", table="users", pk="id")
def get_user(): pass
```

HTTP in, JSON out. Python never touches the data. 128k req/s on DB routes.

## License

MIT
