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.3.tar.gz
(4.4 kB
view details)
Built Distribution
File details
Details for the file opyration-0.2.3.tar.gz
.
File metadata
- Download URL: opyration-0.2.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.9.6 Darwin/24.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64bf0e1479e177322df8066ccc0d6fcf904c1817d2d126d613535bec3fc64008 |
|
MD5 | 59ea912a5afbbb68fdb2c84607353457 |
|
BLAKE2b-256 | 5980d1e41fab5963fe60ff384fb6468e7a592033026744e723d6ab370588cca3 |
File details
Details for the file opyration-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: opyration-0.2.3-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.9.6 Darwin/24.1.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bc09760db7702a1be6c3cad8dbd33043b25b047d28aa3a5c57b5eb76db1a4e4d |
|
MD5 | 62f26792e3485247a41512ef38e1dcaf |
|
BLAKE2b-256 | d1fb8b56519e2c559c2e1e7747226457b4c84bc269329ec8cd3b96a775c6c899 |