Skip to main content

fastasyncpg

Installation

Install latest from pypi

$ pip install fastasyncpg

How to use

Create one Database at import time, and connect it at app startup:

from fastasyncpg.core import Database

db = Database()          # module-level singleton, importable everywhere

async def startup(): await db.connect(database='mydb')

Queries run through the pool by default. transaction (and acquire) make a single connection current for the running task via a ContextVar, so everything inside the block – including table helpers and code called indirectly – joins the transaction, with no handle-passing:

async with db.transaction():
    await db.execute('SELECT 1 FROM "user" WHERE id=$1 FOR UPDATE', uid)
    await db.t.user.update(pk_values=[uid], credits=100)

See the API docs for table access (db.t), auto-generated dataclasses, queue helpers (claim_one), and more.

Release files for fastasyncpg 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fastasyncpg 0.1.0
File Size Uploaded
fastasyncpg-0.1.0.tar.gz 17.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastasyncpg 0.1.0
File Interpreter ABI Platform
fastasyncpg-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 34.4 kB

Release files / fastasyncpg-0.1.0.tar.gz

Download URL fastasyncpg-0.1.0.tar.gz
Size 17.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1f770d9036963d64d2c17814b12765c3ab19c84562ba1bc2ce393648bfcae355
BLAKE2b-256 checksum
How to use checksums
5eb8a7c5b071d297998a8628f7198b9e2ce04a8c3e24e2544628ab374da91eee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release files / fastasyncpg-0.1.0-py3-none-any.whl

Download URL fastasyncpg-0.1.0-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c6124c03a049adeed0a8b36d3a39e578128c87ec7a58be5e96ebf234c928344
BLAKE2b-256 checksum
How to use checksums
ef9ab7887c9766154288bc01ccc30e83ece8b9b2f2f2677d3e88a6da6e915e49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.2

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page