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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: opyration-0.2.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.9.6 Darwin/24.1.0

File hashes

Hashes for opyration-0.2.4.tar.gz
Algorithm Hash digest
SHA256 04127efaf1ecd507e255e82ab19ae1a7b5a7f2c255aaf9f6520c9edd4b893e22
MD5 460fb6b2d212d73ae4ad723ec33aeb1c
BLAKE2b-256 e4d7b9b3d12ce954848d06c0cf88b6ac3860b3556ccc3a621840626292127d85

See more details on using hashes here.

File details

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

File metadata

  • Download URL: opyration-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.9.6 Darwin/24.1.0

File hashes

Hashes for opyration-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6d146e7d5234e39d644a2538da033a4821d33bd77b33aa1dd48a8a665551fa53
MD5 1ddd8fc86faaaba805474fe0ca41854b
BLAKE2b-256 9ed58a21b834963b445043675b845c2d73e1fa0316921c87c9bec9a746695b10

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