Skip to main content

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

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opyration-0.2.6-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

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

Hashes for opyration-0.2.6.tar.gz
Algorithm Hash digest
SHA256 843d3ad6a0d148b246fc31ef2d12eb6a44796e93ae7426c2e0520b43658dc738
MD5 d3f027a2ea8bdeeb0d010601ee32c39b
BLAKE2b-256 c71d6725353b8ba5a2473346f818f360a5f161965cf0fac12c7143c33b3c2597

See more details on using hashes here.

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

Hashes for opyration-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d3b42ba918de41e2a32f96811626e4c9e71892d7eb1a21ac315f44796b7d92bb
MD5 a5fd90438a881561e87794dc17806964
BLAKE2b-256 7016e5472759ae93e4af646d3e37c852f608e0a7bce8c643e1943b033c2313f8

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page