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.5.tar.gz
(4.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file opyration-0.2.5.tar.gz.
File metadata
- Download URL: opyration-0.2.5.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.14.0-24-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8e1c866c8be780572e734274b30570131109fa1b20505414e2713c73ff38a9e
|
|
| MD5 |
8a01cb3abaf1a425827f711b2922fa95
|
|
| BLAKE2b-256 |
01bc1b8c04e5f360593bf27b883f865d7b4ccd78566ec4004190001999e549dc
|
File details
Details for the file opyration-0.2.5-py3-none-any.whl.
File metadata
- Download URL: opyration-0.2.5-py3-none-any.whl
- Upload date:
- Size: 5.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.14.0-24-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ac2391a629bcd57ea85dd6c42fa7ff5e1ed6cf01e152d1260de9077684b8db2
|
|
| MD5 |
96bd7372afbe1a60940b32f9d380f1e1
|
|
| BLAKE2b-256 |
3fb1e7bce0f663eb6dc8d3f425ea9f4fdb2f10f49f5451d7b9b2972afcfcec85
|