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.11.tar.gz
(6.9 kB
view details)
Built Distribution
File details
Details for the file aio-databases-0.0.11.tar.gz
.
File metadata
- Download URL: aio-databases-0.0.11.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.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e8767213fa0945c28995a48cd1577d096f065c4fb6c78eecdbe174f883c7aba6 |
|
MD5 | f71714b7c074d72996e026adf0fb966d |
|
BLAKE2b-256 | a9078947d99cb1bba44554d2f034ec0e60ee8d41af7d7a04bca8885ff6c6a79a |
File details
Details for the file aio_databases-0.0.11-py3-none-any.whl
.
File metadata
- Download URL: aio_databases-0.0.11-py3-none-any.whl
- Upload date:
- Size: 8.2 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.2 CPython/3.9.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 80e55743ab5bb07e5de20b0894234a787c46b5652b35697ff2bf19336ae42193 |
|
MD5 | 10427de5f2ed4a6e85860138c9e10375 |
|
BLAKE2b-256 | d4c49db9d4407a96491569bfe3e704e5fbc39af77f8f0fd45695c1787d9f156f |