A fast and easy-to-use asyncio ORM(Object-relational Mapper) for performing C.R.U.D. ops within RBDMS tables using python.
Key Features
- asyncio ready
- database / table query cache
- SQL-like query syntax
- Automatic schema discovery / migrations
Documentation
https://aiopyql.readthedocs.io/
Instalation
$ virtualenv -p python3.7 aiopyql-env
$ source aiopyql-env/bin/activate
(aiopyql-env)$ pip install aiopyql
Compatable Databases
Getting Started
import asyncio
from aiopyql import data
async def main():
#sqlite connection
sqlite_db = await data.Database.create(
database="testdb"
)
# create table
await db.create_table(
'keystore',
[
('key', str, 'UNIQUE NOT NULL'),
('value', str)
],
'key',
cache_enabled=True
)
# insert
await db.tables['keystore'].insert(
key='foo',
value={'bar': 30}
)
# update
await db.tables['keystore'].update(
value={'bar': 31},
where={'key': 'foo'}
)
# delete
await db.tables['keystore'].delete(
where={'key': 'foo'}
)
loop = asyncio.new_event_loop()
loop.run_until_complete(main())
Recipies
See other usage examples in recipies.
Postgres
import asyncio
from aiopyql import data
async def main():
mysql_db = await data.Database.create(
database='postgres_database',
user='postgres',
password='my-secret-pw',
host='localhost',
port=5432,
db_type='postgres'
)
loop = asyncio.new_event_loop()
loop.run_until_complete(main())
Mysql
import asyncio
from aiopyql import data
async def main():
mysql_db = await data.Database.create(
database='mysql_database',
user='mysqluser',
password='my-secret-pw',
host='localhost',
port=3306,
db_type='mysql'
)
loop = asyncio.new_event_loop()
loop.run_until_complete(main())
Idea / Suggestion / Issue
- Submit an Issue
- Create a Pull request
Metadata
Release files for aiopyql 0.359
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| aiopyql-0.359-py3-none-any.whl | Python 3 | none | any | Details for aiopyql-0.359-py3-none-any.whl |
Release files / aiopyql-0.359-py3-none-any.whl
| Download URL | aiopyql-0.359-py3-none-any.whl |
|---|---|
| Size | 26.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
137e15cbaa7e57572d733ad2318988123a5f9b33f95117ee4157c2f6b160ba2a
|
|
BLAKE2b-256 checksum How to use checksums |
96e75658aa1cc8a7d154d2d74cbb10d0f5cec405d9307ad547de7633966d4200
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.10
|
Security for aiopyql 0.359
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.