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.6.tar.gz
(4.3 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.6.tar.gz.
File metadata
- Download URL: opyration-0.2.6.tar.gz
- Upload date:
- Size: 4.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.14.0-32-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
843d3ad6a0d148b246fc31ef2d12eb6a44796e93ae7426c2e0520b43658dc738
|
|
| MD5 |
d3f027a2ea8bdeeb0d010601ee32c39b
|
|
| BLAKE2b-256 |
c71d6725353b8ba5a2473346f818f360a5f161965cf0fac12c7143c33b3c2597
|
File details
Details for the file opyration-0.2.6-py3-none-any.whl.
File metadata
- Download URL: opyration-0.2.6-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/6.14.0-32-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3b42ba918de41e2a32f96811626e4c9e71892d7eb1a21ac315f44796b7d92bb
|
|
| MD5 |
a5fd90438a881561e87794dc17806964
|
|
| BLAKE2b-256 |
7016e5472759ae93e4af646d3e37c852f608e0a7bce8c643e1943b033c2313f8
|