Skip to main content

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


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)

Uploaded Source

Built Distribution

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

turbopg-0.1.0rc1-py3-none-any.whl (1.9 kB view details)

Uploaded Python 3

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

Hashes for turbopg-0.1.0rc1.tar.gz
Algorithm Hash digest
SHA256 8e6b0e98cb79def6b76f059ac8d4ad6b8f6e1638799fca99f59363ecf3380821
MD5 c789c619077cf9937504b99817cac655
BLAKE2b-256 c961468dd85242ce41d7018beb43cbc368f4fddb60048ab840f2212ff8e1e70f

See more details on using hashes here.

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

Hashes for turbopg-0.1.0rc1-py3-none-any.whl
Algorithm Hash digest
SHA256 6258179d458163dc8dd4c1985bda8450017b64a419d98e034e74bc3f59396336
MD5 f25d689f17e7521534a6f1931c680492
BLAKE2b-256 00f52966b164518e950bff2c30f86c509030c1b9f771aac130f4f09de098dfeb

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