Tools to make Peewee work when using Asyncio
Project description
aio-peewee – Use Peewee with async framework
The library doesn’t make peewee work async, but allows you to use Peewee with your asyncio based libraries correctly.
Features
Tasks Safety. The library tracks of the connection state using asyncio.Task-local storage, making the Peewee Database object safe to use with multiple tasks inside a loop.
Async support for connections. Connect to database asyncroniously
Async support for Peewee Connections Pool
Requirements
python >= 3.8
Installation
aio-peewee should be installed using pip:
pip install aio-peewee
QuickStart
from aiopeewee import db_url
db = db_url.connect('postgres+async://locahost:5432/database')
async def main(id=1):
async with db:
item = Model.get(Model.id == 1)
return item.name
Usage
Initialization
TODO
Connection Pooling
TODO
Database URL
TODO
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/aio-peewee/issues
Contributing
Development of the project happens at: https://github.com/klen/aio-peewee
License
Licensed under a MIT license.
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 Distributions
Built Distribution
File details
Details for the file aio_peewee-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: aio_peewee-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.6.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | aff51163b2bb431f8516fa6a067841c094909bea6fcae99a96dbe5afa4802944 |
|
MD5 | 5d081ca4358171797f67701cc475ee1e |
|
BLAKE2b-256 | 34fa02685cd222b620276e6f19885cd64fbcba9123c47a60ac385ff9f4968e28 |