Execute SQL Statements as a series of pythonic functions.
Project description
Opyration
SQL and Python should be simple right? Sometimes code is better than extensive explanation - see snippets below:
from opyration import Operation
pool = ... # in production use an asyncpg|aiomysql Pool()
# example 1
op = Operation('customers', ...).select().where(location='California', age__gt=18)
await op.run()
# example 2
op = Operation('products', ...)
op.select()
op..where(username='; drop customers')
assert op.sql = 'SELECT * FROM products WHERE id = $1'
Installling
Install with pip
$ pip install opyration
More Examples
from opyration import Operation
op = Operation()
op.update(username='new username').where(id='1ea-455-bc0-88a')
# to run in sync mode use: op.runs()
await op.run() # async
Contributing
For guidance on how to make contributions to opyration, see the Contribution Guidelines
Links
- Documentation Go To Docs
- PyPi https://pypi.org/project/heaven
- Source Code Github
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
opyration-0.2.0.tar.gz
(4.6 kB
view details)
Built Distribution
File details
Details for the file opyration-0.2.0.tar.gz
.
File metadata
- Download URL: opyration-0.2.0.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d027f4eccac1ba255df620b7fd16f5e83f37f8e65eea72b573744252db999a10 |
|
MD5 | 6899b073f6f4aa1a4a92f27e12daf20c |
|
BLAKE2b-256 | 3864bc669133d2cf142ba048398de2a6b7edecced980047499dbe1796079b649 |
File details
Details for the file opyration-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: opyration-0.2.0-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/23.4.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae57f12e6d69b768b48728e490f89576b45717ee7a9c79b02aa042e4d813f85f |
|
MD5 | bb1154f64d5c4c93b38028508f559679 |
|
BLAKE2b-256 | 0573f1fb41566a2bd2a941acd68fa2d47a8dc66d8587c594e0429ea4660d9b65 |