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.0.tar.gz (69.3 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.0-py3-none-any.whl (13.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: litestar_oracledb-0.1.0.tar.gz
  • Upload date:
  • Size: 69.3 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.0.tar.gz
Algorithm Hash digest
SHA256 d1ea151d4a83f9b2e408b99bacdb72329790d25377c656d055b6e95092718b05
MD5 2e383fb339d28eb7780c0146e6ffe6a1
BLAKE2b-256 4979f8f83897d7f3a15142b7c55e118007370770af3789594ff622229ed02c43

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for litestar_oracledb-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 5878c52485645b634c4b6706264791de7d16fc6c726e67f78bf8e2db72c1ecf4
MD5 6a931c4fa44b9cd57af71c47d65a8003
BLAKE2b-256 077426afbe202b39b52a0c957b7e57d5a59a8ee98db055e0c5c1d627592ea3c7

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

0.1.1

2 files

This release

0.1.0 This release

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