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.2.tar.gz
(4.5 kB
view details)
Built Distribution
File details
Details for the file opyration-0.2.2.tar.gz
.
File metadata
- Download URL: opyration-0.2.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/23.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9ea8bb412b8dc32232004e9d0a44b35ec69df0713697428a4dba838a0954fed6 |
|
MD5 | 018dd5fcfae798720127f4d95250a285 |
|
BLAKE2b-256 | f10e015c1b0bd29c9b20523fa39f3b11dad4d1e6e60f45309cc2ca99213adaed |
File details
Details for the file opyration-0.2.2-py3-none-any.whl
.
File metadata
- Download URL: opyration-0.2.2-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.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 022f0b2d046f4faa4212be07bcbeaf79604a3c97715a3d5671fd3a4a3ff4f3f3 |
|
MD5 | a6a0b91a8bf18ff4f6d4c421e3ff1690 |
|
BLAKE2b-256 | 961f24171ab63b060cd6f53e1d80725e7cd530e5ef62e0065b16b871c582827b |