Zig-native Postgres client for Python — zero-overhead queries powered by pg.zig
Project description
TurboPG
Zig-native Postgres client for Python. Zero-overhead database operations powered by pg.zig.
Install
pip install turbopg
# With psycopg2 fallback:
pip install turbopg[psycopg2]
Usage
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)
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
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
turbopg-0.1.0rc1.tar.gz
(2.1 kB
view details)
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 turbopg-0.1.0rc1.tar.gz.
File metadata
- Download URL: turbopg-0.1.0rc1.tar.gz
- Upload date:
- Size: 2.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e6b0e98cb79def6b76f059ac8d4ad6b8f6e1638799fca99f59363ecf3380821
|
|
| MD5 |
c789c619077cf9937504b99817cac655
|
|
| BLAKE2b-256 |
c961468dd85242ce41d7018beb43cbc368f4fddb60048ab840f2212ff8e1e70f
|
File details
Details for the file turbopg-0.1.0rc1-py3-none-any.whl.
File metadata
- Download URL: turbopg-0.1.0rc1-py3-none-any.whl
- Upload date:
- Size: 1.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6258179d458163dc8dd4c1985bda8450017b64a419d98e034e74bc3f59396336
|
|
| MD5 |
f25d689f17e7521534a6f1931c680492
|
|
| BLAKE2b-256 |
00f52966b164518e950bff2c30f86c509030c1b9f771aac130f4f09de098dfeb
|