|
1 | 1 | <!-- markdownlint-disable --> |
2 | 2 | <p align="center"> |
3 | 3 | <!-- github-banner-start --> |
4 | | - <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/asyncPG%20-%20Banner%20-%20Inline%20-%20Light.svg#gh-light-mode-only" alt="Litestar Logo - Light" width="100%" height="auto" /> |
5 | | - <img src="https://raw.githubusercontent.com/litestar-org/branding/main/assets/Branding%20-%20SVG%20-%20Transparent/asyncPG%20-%20Banner%20-%20Inline%20-%20Dark.svg#gh-dark-mode-only" alt="Litestar Logo - Dark" width="100%" height="auto" /> |
| 4 | + <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" /> |
| 5 | + <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" /> |
6 | 6 | <!-- github-banner-end --> |
7 | 7 | </p> |
8 | 8 | <!-- markdownlint-restore --> |
|
15 | 15 | | --------- | :-- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
16 | 16 | | CI/CD | | [](https://github.com/litestar-org/litestar-oracledb/actions/workflows/publish.yml) [](https://github.com/litestar-org/litestar-oracledb/actions/workflows/ci.yml) [](https://github.com/litestar-org/litestar-oracledb/actions/workflows/docs.yml) | |
17 | 17 | | Quality | | [](https://codecov.io/github/litestar-org/litestar-oracledb) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) [](https://sonarcloud.io/summary/new_code?id=litestar-org_litestar-oracledb) | |
18 | | -| Package | | [](https://badge.fury.io/py/litestar)   | |
| 18 | +| Package | | [](https://badge.fury.io/py/litestar)   | |
19 | 19 | | Community | | [](https://reddit.com/r/litestarapi) [](https://discord.gg/litestar) [](https://matrix.to/#/#litestar:matrix.org) [](https://blog.litestar.dev) [](https://twitter.com/LitestarAPI) [](https://blog.litestar.dev) | |
20 | 20 | | Meta | | [](https://github.com/litestar-org/litestar-oracledb) [](https://github.com/python/mypy) [](https://spdx.org/licenses/) [](https://github.com/sponsors/litestar-org) [](https://github.com/astral-sh/ruff) [](https://github.com/psf/black) | |
21 | 21 |
|
@@ -52,11 +52,15 @@ class SampleController(Controller): |
52 | 52 | @get(path="/sample") |
53 | 53 | async def sample_route(self, db_connection: Connection) -> dict[str, str]: |
54 | 54 | """Check database available and returns app config info.""" |
55 | | - result = await db_connection.fetch("select 1") |
| 55 | + cursor = db_connection.cursor() |
| 56 | + await cursor.execute("select 1 from dual") |
| 57 | + result = await cursor.fetchone() |
56 | 58 | return {"select_1": str(result)} |
57 | 59 |
|
58 | 60 |
|
59 | | -oracledb = AsyncpgPlugin(config=AsyncpgConfig(pool_config=PoolConfig(dsn="postgresql://app:app@localhost:5432/app"))) |
| 61 | +oracledb = OracleDatabasePlugin( |
| 62 | + config=AsyncDatabaseConfig(pool_config=AsyncPoolConfig(user="app", password="super-secret", dsn="localhost:1521/freepdb1")) |
| 63 | +) |
60 | 64 | app = Litestar(plugins=[oracledb], route_handlers=[SampleController]) |
61 | 65 |
|
62 | 66 | ``` |
0 commit comments