-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: support multi-config * chore: bump version
- Loading branch information
Showing
12 changed files
with
295 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,19 @@ | ||
from __future__ import annotations | ||
|
||
from litestar_oracledb.config import AsyncDatabaseConfig, AsyncPoolConfig, SyncDatabaseConfig, SyncPoolConfig | ||
from litestar_oracledb import exceptions | ||
from litestar_oracledb.config import ( | ||
AsyncOracleDatabaseConfig, | ||
AsyncOraclePoolConfig, | ||
SyncOracleDatabaseConfig, | ||
SyncOraclePoolConfig, | ||
) | ||
from litestar_oracledb.plugin import OracleDatabasePlugin | ||
|
||
__all__ = ("SyncDatabaseConfig", "AsyncDatabaseConfig", "SyncPoolConfig", "AsyncPoolConfig", "OracleDatabasePlugin") | ||
__all__ = ( | ||
"SyncOracleDatabaseConfig", | ||
"AsyncOracleDatabaseConfig", | ||
"SyncOraclePoolConfig", | ||
"AsyncOraclePoolConfig", | ||
"OracleDatabasePlugin", | ||
"exceptions", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
from __future__ import annotations | ||
|
||
from litestar_oracledb.config._asyncio import AsyncDatabaseConfig, AsyncPoolConfig | ||
from litestar_oracledb.config._common import GenericDatabaseConfig, GenericPoolConfig | ||
from litestar_oracledb.config._sync import SyncDatabaseConfig, SyncPoolConfig | ||
from litestar_oracledb.config._asyncio import AsyncOracleDatabaseConfig, AsyncOraclePoolConfig | ||
from litestar_oracledb.config._common import GenericOracleDatabaseConfig, GenericOraclePoolConfig | ||
from litestar_oracledb.config._sync import SyncOracleDatabaseConfig, SyncOraclePoolConfig | ||
|
||
__all__ = ( | ||
"SyncDatabaseConfig", | ||
"SyncPoolConfig", | ||
"AsyncDatabaseConfig", | ||
"AsyncPoolConfig", | ||
"GenericDatabaseConfig", | ||
"GenericPoolConfig", | ||
"SyncOracleDatabaseConfig", | ||
"SyncOraclePoolConfig", | ||
"AsyncOracleDatabaseConfig", | ||
"AsyncOraclePoolConfig", | ||
"GenericOracleDatabaseConfig", | ||
"GenericOraclePoolConfig", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
from __future__ import annotations | ||
|
||
from typing import Any | ||
|
||
from litestar.exceptions import LitestarException | ||
|
||
|
||
class LitestarOracleException(LitestarException): | ||
"""Base exception class from which all Litestar Oracle database exceptions inherit.""" | ||
|
||
detail: str | ||
|
||
def __init__(self, *args: Any, detail: str = "") -> None: | ||
"""Initialize ``AdvancedAlchemyException``. | ||
Args: | ||
*args: args are converted to :class:`str` before passing to :class:`Exception` | ||
detail: detail of the exception. | ||
""" | ||
str_args = [str(arg) for arg in args if arg] | ||
if not detail: | ||
if str_args: | ||
detail, *str_args = str_args | ||
elif hasattr(self, "detail"): | ||
detail = self.detail | ||
self.detail = detail | ||
super().__init__(*str_args) | ||
|
||
def __repr__(self) -> str: | ||
if self.detail: | ||
return f"{self.__class__.__name__} - {self.detail}" | ||
return self.__class__.__name__ | ||
|
||
def __str__(self) -> str: | ||
return " ".join((*self.args, self.detail)).strip() | ||
|
||
|
||
class ImproperConfigurationError(LitestarOracleException): | ||
"""Improper Configuration error.LitestarOracleException | ||
This exception is raised only when a module depends on a dependency that has not been installed. | ||
""" |
Oops, something went wrong.