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

Uploaded Source

Built Distribution

opyration-0.0.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for opyration-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a27279093bb9d23b173c750b61a5d2d927e22258fd4b4fe6327a2e6da726786b
MD5 05bbe74413565b52d11bcfa237603829
BLAKE2b-256 9a530566b99c75de94f24a7929df137917e511f5eba13fa3548aa644eaa2c7fa

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for opyration-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0b862f86a6b49d767bf6db0e1ff9497a00f6b2cc1a129af795eb099f4b7f2c9e
MD5 b5997742196e7170f96af2aef239b3f6
BLAKE2b-256 c81b307286e1405f028c8b647208432ad6a1c85472a21edf7779e2012d20718d

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