Skip to main content

Litestar Logo - Light Litestar Logo - Dark

Project Status
CI/CD Latest Release ci Documentation Building
Quality Coverage Quality Gate Status Maintainability Rating Reliability Rating Security Rating
Package PyPI - Version PyPI - Support Python Versions Litestar OracleDB PyPI - Downloads
Community Reddit Discord Matrix Medium Twitter Blog
Meta Litestar Project types - Mypy License - MIT Litestar Sponsors linting - Ruff code style - Ruff
# 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

pip install litestar-oracledb

Example

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

from __future__ import annotations

from typing import TYPE_CHECKING

from litestar import Controller, Litestar, get
from litestar_oracledb import AsyncDatabaseConfig, AsyncPoolConfig, OracleDatabasePlugin

if TYPE_CHECKING:
    from oracledb import AsyncConnection


class SampleController(Controller):
    @get(path="/sample")
    async def sample_route(self, db_connection: AsyncConnection) -> dict[str, str]:
        """Check database available and returns app config info."""
        cursor = db_connection.cursor()
        await cursor.execute("select 1 from dual")
        result = await cursor.fetchone()
        return {"select_1": str(result)}


oracledb = OracleDatabasePlugin(
    config=AsyncDatabaseConfig(pool_config=AsyncPoolConfig(user="app", password="super-secret", dsn="localhost:1521/freepdb1"))
)
app = Litestar(plugins=[oracledb], route_handlers=[SampleController])

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

litestar_oracledb-0.1.1.tar.gz (69.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

litestar_oracledb-0.1.1-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

Details for the file litestar_oracledb-0.1.1.tar.gz.

File metadata

  • Download URL: litestar_oracledb-0.1.1.tar.gz
  • Upload date:
  • Size: 69.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for litestar_oracledb-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7abaf883c1c6a5cb78f78b1d4dad481458aca5b502e8261415875387d0fae6bc
MD5 fa1f1759ca035339b2a1d1f7d95276c7
BLAKE2b-256 d953b8f68bfc1de20dab63cf0e6026f597f65bc69c945dedc6bf73d21528762c

See more details on using hashes here.

File details

Details for the file litestar_oracledb-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for litestar_oracledb-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3427bf6a3177f1950eb4ff1394578270cc79343f49b983fff0ed87d1ec86527d
MD5 5069ee10ab7de14c9eb33dd542a5ed23
BLAKE2b-256 4e685810dffb2c1ffddac8a6270e74bc8df74906d06989748b041b2e77de1821

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.0

2 files

0.1.3

2 files

0.1.2

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page