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.0.7.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

opyration-0.0.7-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file opyration-0.0.7.tar.gz.

File metadata

  • Download URL: opyration-0.0.7.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/23.3.0

File hashes

Hashes for opyration-0.0.7.tar.gz
Algorithm Hash digest
SHA256 7dd0a55a5ce3c3bb5c6e3e4570984f727403a960db634278179b9f54c3faae24
MD5 736aec28f38b93affd38a712cd577bbf
BLAKE2b-256 6458b524f1e7a551584656ee0c3b1b3fc4e8a0c295eb815c2fced59a2a053284

See more details on using hashes here.

File details

Details for the file opyration-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: opyration-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 5.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.4.2 CPython/3.11.3 Darwin/23.3.0

File hashes

Hashes for opyration-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e0ed9a05dfde142f45dabb97a661ffcc5b2156d8490f8a35f749f83478521924
MD5 63ebbf803dd59f167ba2b6ca665413b6
BLAKE2b-256 22df2fb2554ec9aecf73122b7b7b465af3ce07d0b26c0ce489404283320eae45

See more details on using hashes here.

Supported by

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