Async Support for various databases
Project description
AIO-Databases
The package gives you asycio support for a range of databases (SQLite, PostgreSQL, MySQL).
Requirements
- python >= 3.7
Installation
aio-databases should be installed using pip:
$ pip install aio-databases
You can install the required database drivers with:
$ pip install aio-databases[sqlite]
$ pip install aio-databases[postgresql]
$ pip install aio-databases[mysql]
Usage
from aio_databases import Database
db = Database('sqlite:///:memory:')
await db.execute('select $1', '1')
await db.executemany('select $1', '1', '2', '3')
res = await db.fetchall('select (2 * $1) res', 2)
assert res == [(4,)]
res = await db.fetchone('select (2 * $1) res', 2)
assert res == (4,)
assert isinstance(res, db.backend.record_cls)
res = await db.fetchval('select 2 * $1', 2)
assert res == 4
Bug tracker
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/aio-databases/issues
Contributing
Development of the project happens at: https://github.com/klen/aio-databases
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 Distribution
aio-databases-0.0.9.tar.gz
(6.9 kB
view details)
Built Distribution
File details
Details for the file aio-databases-0.0.9.tar.gz
.
File metadata
- Download URL: aio-databases-0.0.9.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97cc5706d97dd2866a05a232dbd5974b0bbc39e08eec446a395ec0d2cebbdfb4 |
|
MD5 | 57f6b95d0a0f5c11f2082236c0c63e84 |
|
BLAKE2b-256 | 8bb42a4e14eaa0447a4124cb8a1dd340f2e44ed9c29a2de0872843ee5521ef20 |
File details
Details for the file aio_databases-0.0.9-py3-none-any.whl
.
File metadata
- Download URL: aio_databases-0.0.9-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dab977ca3f7ec8b98104a047acedce24ddc898b0ed989960ba12a5fe5e193053 |
|
MD5 | 36465314fdb70f0e5e3e2d14ba2bfe6d |
|
BLAKE2b-256 | 1a9dd15d4c2f666a673cab7f0661d95201f7b41d0a6de0a97842aeab3665e710 |