almasql


Namealmasql JSON
Version 0.2.6 PyPI version JSON
download
home_pagehttps://github.com/aturkenov/almasql
SummarySimple library for dynamic SQL queries
upload_time2024-09-14 19:04:55
maintainerNone
docs_urlNone
authoraturkenov
requires_python<4.0,>=3.12
licenseMIT
keywords sql almasql
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            AlmaSQL

<details>
<summary>Directives</summary>

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.

<details>
<summary>set</summary>

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

```jinja
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.

```jinja
UPDATE book{{ set({'title': 'Why do I love almasql?', 'is_active': True}) }}
WHERE id = :id
```
</details>
</details>

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/aturkenov/almasql",
    "name": "almasql",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.12",
    "maintainer_email": null,
    "keywords": "SQL, AlmaSQL",
    "author": "aturkenov",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/18/b6/1fe5e6838e23cba4ed5d9e4ea2ffc8b0f93b4ff89b6a5ae47fb6eb3ca5e0/almasql-0.2.6.tar.gz",
    "platform": null,
    "description": "AlmaSQL\n\n<details>\n<summary>Directives</summary>\n\nDirectives are functions that can extend AlmaSQL by customizing the way an expression renders.\n\nUsing a directive in your template is as simple as calling a function in a template expression.\n\nAlmaSQL includes a number of built-in directives like `set` and `values`.\n\nUsers can also write their own custom directives.\n\n<details>\n<summary>set</summary>\n\nImagine table `book` and columns `id`, `title`, and `is_active`.\nAnd you want to update book by id.\n\n```jinja\nUPDATE book\nSET title = :title, is_active = :is_active\nWHERE id = :id\n```\n\nBut when you need to modify column, you need to change the query template.\nWhat if you forgot to do it? This will lead to unexpected bugs.\nSo better to use directives that, depending on the arguments,\nwill render the required columns and values.\n\n```jinja\nUPDATE book{{ set({'title': 'Why do I love almasql?', 'is_active': True}) }}\nWHERE id = :id\n```\n</details>\n</details>\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Simple library for dynamic SQL queries",
    "version": "0.2.6",
    "project_urls": {
        "Documentation": "https://github.com/aturkenov/almasql",
        "Homepage": "https://github.com/aturkenov/almasql",
        "Repository": "https://github.com/aturkenov/almasql"
    },
    "split_keywords": [
        "sql",
        " almasql"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0ae4c669cdf72936cdb17baa78ab40815b864677e06f1c8f2bd61169c2757be",
                "md5": "96dd2c8ada067ac3c901a77e5fbf448c",
                "sha256": "ee2e5354526c1003f0a88e0405d345ab92872e803d29b2a13bb8f8d389666540"
            },
            "downloads": -1,
            "filename": "almasql-0.2.6-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "96dd2c8ada067ac3c901a77e5fbf448c",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.12",
            "size": 8109,
            "upload_time": "2024-09-14T19:04:53",
            "upload_time_iso_8601": "2024-09-14T19:04:53.449780Z",
            "url": "https://files.pythonhosted.org/packages/b0/ae/4c669cdf72936cdb17baa78ab40815b864677e06f1c8f2bd61169c2757be/almasql-0.2.6-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "18b61fe5e6838e23cba4ed5d9e4ea2ffc8b0f93b4ff89b6a5ae47fb6eb3ca5e0",
                "md5": "bc99ce6bda6bd52538e2c22a1d669bbc",
                "sha256": "c09f232b7708476fc4b046058a9741d3331209e5532e8f5d95bf6071e730a037"
            },
            "downloads": -1,
            "filename": "almasql-0.2.6.tar.gz",
            "has_sig": false,
            "md5_digest": "bc99ce6bda6bd52538e2c22a1d669bbc",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.12",
            "size": 6359,
            "upload_time": "2024-09-14T19:04:55",
            "upload_time_iso_8601": "2024-09-14T19:04:55.100156Z",
            "url": "https://files.pythonhosted.org/packages/18/b6/1fe5e6838e23cba4ed5d9e4ea2ffc8b0f93b4ff89b6a5ae47fb6eb3ca5e0/almasql-0.2.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-14 19:04:55",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "aturkenov",
    "github_project": "almasql",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "almasql"
}
        
Elapsed time: 0.33955s