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.5.tar.gz (4.2 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.5-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

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

Hashes for opyration-0.2.5.tar.gz
Algorithm Hash digest
SHA256 c8e1c866c8be780572e734274b30570131109fa1b20505414e2713c73ff38a9e
MD5 8a01cb3abaf1a425827f711b2922fa95
BLAKE2b-256 01bc1b8c04e5f360593bf27b883f865d7b4ccd78566ec4004190001999e549dc

See more details on using hashes here.

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

Hashes for opyration-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 2ac2391a629bcd57ea85dd6c42fa7ff5e1ed6cf01e152d1260de9077684b8db2
MD5 96bd7372afbe1a60940b32f9d380f1e1
BLAKE2b-256 3fb1e7bce0f663eb6dc8d3f425ea9f4fdb2f10f49f5451d7b9b2972afcfcec85

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