Skip to main content

Simple library for dynamic SQL queries

Project description

AlmaSQL

Directives

Directives are functions that can extend AlmaSQL by customizing the way an expression renders.

Using a directive in your template is as simple as calling a function in a template expression.

AlmaSQL includes a number of built-in directives like set and values.

Users can also write their own custom directives.

set

Imagine table book and columns id, title, and is_active. And you want to update book by id.

UPDATE book
SET title = :title, is_active = :is_active
WHERE id = :id

But when you need to modify column, you need to change the query template. What if you forgot to do it? This will lead to unexpected bugs. So better to use directives that, depending on the arguments, will render the required columns and values.

UPDATE book{{ set({'title': 'Why do I love almasql?', 'is_active': True}) }}
WHERE id = :id

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

almasql-0.2.4.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

almasql-0.2.4-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: almasql-0.2.4.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Darwin/22.6.0

File hashes

Hashes for almasql-0.2.4.tar.gz
Algorithm Hash digest
SHA256 947622c92a7ce74b0753521fbe8fc6bce0dd36c087e78ab8a17b23dbf228302d
MD5 05f1cae1263eb45c1d7f60c09f8dc9d4
BLAKE2b-256 1afcb33d1781e15d6d793c30a81699884caf147d997d0d8ae455d90a5ddb8c21

See more details on using hashes here.

Provenance

File details

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

File metadata

  • Download URL: almasql-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 8.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Darwin/22.6.0

File hashes

Hashes for almasql-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f59fb5f5a993bfacb7af692042dc55b6c4d667ea8db128ef8b684cea8314fbf7
MD5 681eb4c1268c20cc0e26a25d29a57cb9
BLAKE2b-256 df8474fcea36c51dbec24b7112a434f07579dd61e0b3118bb3a914a61e47da78

See more details on using hashes here.

Provenance

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