litestar-oracledb


Namelitestar-oracledb JSON
Version 0.1.3 PyPI version JSON
download
home_pageNone
SummaryOracle DB plugin for Litestar
upload_time2024-08-30 19:19:14
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords litestar oracle
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <!-- markdownlint-disable -->
<p align="center">
  <!-- github-banner-start -->
  <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/oracledb%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only" alt="Litestar Logo - Light" width="100%" height="auto" />
  <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/oracledb%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only" alt="Litestar Logo - Dark" width="100%" height="auto" />
  <!-- github-banner-end -->
</p>
<!-- markdownlint-restore -->

<div align="center">

<!-- prettier-ignore-start -->

| Project   |     | Status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |
| --------- | :-- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| CI/CD     |     | [![Latest Release](https://github.com/litestar-org/litestar-oracledb/actions/workflows/publish.yml/badge.svg)](https://github.com/litestar-org/litestar-oracledb/actions/workflows/publish.yml) [![ci](https://github.com/litestar-org/litestar-oracledb/actions/workflows/ci.yml/badge.svg)](https://github.com/litestar-org/litestar-oracledb/actions/workflows/ci.yml) [![Documentation Building](https://github.com/litestar-org/litestar-oracledb/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/litestar-org/litestar-oracledb/actions/workflows/docs.yml)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| Quality   |     | [![Coverage](https://codecov.io/github/litestar-org/litestar-oracledb/graph/badge.svg?token=vKez4Pycrc)](https://codecov.io/github/litestar-org/litestar-oracledb) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb)                                                                                            |
| Package   |     | [![PyPI - Version](https://img.shields.io/pypi/v/litestar-oracledb?labelColor=202235&color=edb641&logo=python&logoColor=edb641)](https://badge.fury.io/py/litestar) ![PyPI - Support Python Versions](https://img.shields.io/pypi/pyversions/litestar?labelColor=202235&color=edb641&logo=python&logoColor=edb641) ![Litestar OracleDB PyPI - Downloads](https://img.shields.io/pypi/dm/litestar-oracledb?logo=python&label=package%20downloads&labelColor=202235&color=edb641&logoColor=edb641)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| Community |     | [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/litestarapi?label=r%2FLitestar&logo=reddit&labelColor=202235&color=edb641&logoColor=edb641)](https://reddit.com/r/litestarapi) [![Discord](https://img.shields.io/discord/919193495116337154?labelColor=202235&color=edb641&label=chat%20on%20discord&logo=discord&logoColor=edb641)](https://discord.gg/litestar) [![Matrix](https://img.shields.io/badge/chat%20on%20Matrix-bridged-202235?labelColor=202235&color=edb641&logo=matrix&logoColor=edb641)](https://matrix.to/#/#litestar:matrix.org) [![Medium](https://img.shields.io/badge/Medium-202235?labelColor=202235&color=edb641&logo=medium&logoColor=edb641)](https://blog.litestar.dev) [![Twitter](https://img.shields.io/twitter/follow/LitestarAPI?labelColor=202235&color=edb641&logo=twitter&logoColor=edb641&style=flat)](https://twitter.com/LitestarAPI) [![Blog](https://img.shields.io/badge/Blog-litestar.dev-202235?logo=blogger&labelColor=202235&color=edb641&logoColor=edb641)](https://blog.litestar.dev)                                                                                 |
| Meta      |     | [![Litestar Project](https://img.shields.io/badge/Litestar%20Org-%E2%AD%90%20Advanced%20Alchemy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/litestar-org/litestar-oracledb) [![types - Mypy](https://img.shields.io/badge/types-Mypy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/python/mypy) [![License - MIT](https://img.shields.io/badge/license-MIT-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://spdx.org/licenses/) [![Litestar Sponsors](https://img.shields.io/badge/Sponsor-%E2%9D%A4-%23edb641.svg?&logo=github&logoColor=edb641&labelColor=202235)](https://github.com/sponsors/litestar-org) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json&labelColor=202235)](https://github.com/astral-sh/ruff) [![code style - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/format.json&labelColor=202235)](https://github.com/psf/black) |

</div>
# Litestar - Oracle Database Plugin

A barebones Oracle Database plugin for Litestar. This plugin is useful for when you plan to use no ORM or need to manage the Oracle connection separately.

## Usage

### Installation

```shell
pip install litestar-oracledb
```

### Example

Here is a basic application that demonstrates how to use the plugin.

```python
from __future__ import annotations

from typing import TYPE_CHECKING

from litestar import Controller, Litestar, Request, get

from litestar_oracledb import AsyncDatabaseConfig, AsyncPoolConfig, OracleDatabasePlugin

if TYPE_CHECKING:
    from oracledb import AsyncConnection


class SampleController(Controller):
    @get(path="/")
    async def sample_route(self, request: Request, db_connection: AsyncConnection) -> dict[str, str]:
        """Check database available and returns app config info."""
        with db_connection.cursor() as cursor:
            await cursor.execute("select 'a database value' a_column from dual")
            result = await cursor.fetchone()
            request.logger.info(result[0])
            if result:
                return {"a_column": result[0]}
        return {"a_column": "dunno"}


oracledb = OracleDatabasePlugin(
    config=AsyncDatabaseConfig(
        pool_config=AsyncPoolConfig(user="system", password="super-secret", dsn="localhost:1513/FREEPDB1")  # noqa: S106
    )
)
app = Litestar(plugins=[oracledb], route_handlers=[SampleController])

```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "litestar-oracledb",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "litestar, oracle",
    "author": null,
    "author_email": "Cody Fincher <cody@litestar.dev>",
    "download_url": "https://files.pythonhosted.org/packages/56/1c/1fae5c1a8797c60a14f02ef027b6da4615076262ea0a0563e64f02ebafee/litestar_oracledb-0.1.3.tar.gz",
    "platform": null,
    "description": "<!-- markdownlint-disable -->\n<p align=\"center\">\n  <!-- github-banner-start -->\n  <img src=\"https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/oracledb%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only\" alt=\"Litestar Logo - Light\" width=\"100%\" height=\"auto\" />\n  <img src=\"https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/oracledb%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only\" alt=\"Litestar Logo - Dark\" width=\"100%\" height=\"auto\" />\n  <!-- github-banner-end -->\n</p>\n<!-- markdownlint-restore -->\n\n<div align=\"center\">\n\n<!-- prettier-ignore-start -->\n\n| Project   |     | Status                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |\n| --------- | :-- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| CI/CD     |     | [![Latest Release](https://github.com/litestar-org/litestar-oracledb/actions/workflows/publish.yml/badge.svg)](https://github.com/litestar-org/litestar-oracledb/actions/workflows/publish.yml) [![ci](https://github.com/litestar-org/litestar-oracledb/actions/workflows/ci.yml/badge.svg)](https://github.com/litestar-org/litestar-oracledb/actions/workflows/ci.yml) [![Documentation Building](https://github.com/litestar-org/litestar-oracledb/actions/workflows/docs.yml/badge.svg?branch=main)](https://github.com/litestar-org/litestar-oracledb/actions/workflows/docs.yml)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |\n| Quality   |     | [![Coverage](https://codecov.io/github/litestar-org/litestar-oracledb/graph/badge.svg?token=vKez4Pycrc)](https://codecov.io/github/litestar-org/litestar-oracledb) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=reliability_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=litestar-org_litestar-oracledb&metric=security_rating)](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb)                                                                                            |\n| Package   |     | [![PyPI - Version](https://img.shields.io/pypi/v/litestar-oracledb?labelColor=202235&color=edb641&logo=python&logoColor=edb641)](https://badge.fury.io/py/litestar) ![PyPI - Support Python Versions](https://img.shields.io/pypi/pyversions/litestar?labelColor=202235&color=edb641&logo=python&logoColor=edb641) ![Litestar OracleDB PyPI - Downloads](https://img.shields.io/pypi/dm/litestar-oracledb?logo=python&label=package%20downloads&labelColor=202235&color=edb641&logoColor=edb641)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |\n| Community |     | [![Reddit](https://img.shields.io/reddit/subreddit-subscribers/litestarapi?label=r%2FLitestar&logo=reddit&labelColor=202235&color=edb641&logoColor=edb641)](https://reddit.com/r/litestarapi) [![Discord](https://img.shields.io/discord/919193495116337154?labelColor=202235&color=edb641&label=chat%20on%20discord&logo=discord&logoColor=edb641)](https://discord.gg/litestar) [![Matrix](https://img.shields.io/badge/chat%20on%20Matrix-bridged-202235?labelColor=202235&color=edb641&logo=matrix&logoColor=edb641)](https://matrix.to/#/#litestar:matrix.org) [![Medium](https://img.shields.io/badge/Medium-202235?labelColor=202235&color=edb641&logo=medium&logoColor=edb641)](https://blog.litestar.dev) [![Twitter](https://img.shields.io/twitter/follow/LitestarAPI?labelColor=202235&color=edb641&logo=twitter&logoColor=edb641&style=flat)](https://twitter.com/LitestarAPI) [![Blog](https://img.shields.io/badge/Blog-litestar.dev-202235?logo=blogger&labelColor=202235&color=edb641&logoColor=edb641)](https://blog.litestar.dev)                                                                                 |\n| Meta      |     | [![Litestar Project](https://img.shields.io/badge/Litestar%20Org-%E2%AD%90%20Advanced%20Alchemy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/litestar-org/litestar-oracledb) [![types - Mypy](https://img.shields.io/badge/types-Mypy-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://github.com/python/mypy) [![License - MIT](https://img.shields.io/badge/license-MIT-202235.svg?logo=python&labelColor=202235&color=edb641&logoColor=edb641)](https://spdx.org/licenses/) [![Litestar Sponsors](https://img.shields.io/badge/Sponsor-%E2%9D%A4-%23edb641.svg?&logo=github&logoColor=edb641&labelColor=202235)](https://github.com/sponsors/litestar-org) [![linting - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json&labelColor=202235)](https://github.com/astral-sh/ruff) [![code style - Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/format.json&labelColor=202235)](https://github.com/psf/black) |\n\n</div>\n# Litestar - Oracle Database Plugin\n\nA barebones Oracle Database plugin for Litestar. This plugin is useful for when you plan to use no ORM or need to manage the Oracle connection separately.\n\n## Usage\n\n### Installation\n\n```shell\npip install litestar-oracledb\n```\n\n### Example\n\nHere is a basic application that demonstrates how to use the plugin.\n\n```python\nfrom __future__ import annotations\n\nfrom typing import TYPE_CHECKING\n\nfrom litestar import Controller, Litestar, Request, get\n\nfrom litestar_oracledb import AsyncDatabaseConfig, AsyncPoolConfig, OracleDatabasePlugin\n\nif TYPE_CHECKING:\n    from oracledb import AsyncConnection\n\n\nclass SampleController(Controller):\n    @get(path=\"/\")\n    async def sample_route(self, request: Request, db_connection: AsyncConnection) -> dict[str, str]:\n        \"\"\"Check database available and returns app config info.\"\"\"\n        with db_connection.cursor() as cursor:\n            await cursor.execute(\"select 'a database value' a_column from dual\")\n            result = await cursor.fetchone()\n            request.logger.info(result[0])\n            if result:\n                return {\"a_column\": result[0]}\n        return {\"a_column\": \"dunno\"}\n\n\noracledb = OracleDatabasePlugin(\n    config=AsyncDatabaseConfig(\n        pool_config=AsyncPoolConfig(user=\"system\", password=\"super-secret\", dsn=\"localhost:1513/FREEPDB1\")  # noqa: S106\n    )\n)\napp = Litestar(plugins=[oracledb], route_handlers=[SampleController])\n\n```\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Oracle DB plugin for Litestar",
    "version": "0.1.3",
    "project_urls": {
        "Changelog": "https://litestar-org.github.io/litesatr-oracledb/latest/changelog",
        "Discord": "https://discord.gg/X3FJqy8d2j",
        "Documentation": "https://litestar-org.github.io/litesatr-oracledb/latest/",
        "Homepage": "https://litestar-org.github.io/litesatr-oracledb/latest/",
        "Issue": "https://github.com/litestar-org/litestar-oracledb/issues/",
        "Source": "https://github.com/litestar-org/litestar-oracledb"
    },
    "split_keywords": [
        "litestar",
        " oracle"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1ca4dab5bfe8c13c35a319a999616e8e2dbbc6f5e499a98df81f4daaaaaed56f",
                "md5": "6fa8397811d9c80f500ce75f9b41e510",
                "sha256": "7f1656ed29a899f5b74f5d346df5a0cbfbaf73057f4d11d8761426a8e3bc8021"
            },
            "downloads": -1,
            "filename": "litestar_oracledb-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6fa8397811d9c80f500ce75f9b41e510",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 13673,
            "upload_time": "2024-08-30T19:19:13",
            "upload_time_iso_8601": "2024-08-30T19:19:13.176574Z",
            "url": "https://files.pythonhosted.org/packages/1c/a4/dab5bfe8c13c35a319a999616e8e2dbbc6f5e499a98df81f4daaaaaed56f/litestar_oracledb-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "561c1fae5c1a8797c60a14f02ef027b6da4615076262ea0a0563e64f02ebafee",
                "md5": "ebe0d3bd31975b02e5d49d277c84bce5",
                "sha256": "a83719c817d3c1151b79b65944bb1480f32b333ad8e15d3c2c07d291297ed342"
            },
            "downloads": -1,
            "filename": "litestar_oracledb-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "ebe0d3bd31975b02e5d49d277c84bce5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 69518,
            "upload_time": "2024-08-30T19:19:14",
            "upload_time_iso_8601": "2024-08-30T19:19:14.271453Z",
            "url": "https://files.pythonhosted.org/packages/56/1c/1fae5c1a8797c60a14f02ef027b6da4615076262ea0a0563e64f02ebafee/litestar_oracledb-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-30 19:19:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "litestar-org",
    "github_project": "litestar-oracledb",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "litestar-oracledb"
}
        
Elapsed time: 4.09447s