File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 11from __future__ import annotations
22
3- from typing import TYPE_CHECKING , cast
3+ from typing import TYPE_CHECKING , cast , TypeVar , Generic
44
55from litestar .di import Provide
66from litestar .plugins import InitPluginProtocol
1212 from litestar_oracledb .config import AsyncDatabaseConfig , SyncDatabaseConfig
1313
1414
15+ ConfigT = TypeVar ("ConfigT" , bound = "AsyncDatabaseConfig | SyncDatabaseConfig" )
16+
17+
1518class SlotsBase :
1619 __slots__ = ("_config" ,)
1720
1821
19- class OracleDatabasePlugin (InitPluginProtocol , SlotsBase ):
22+ class OracleDatabasePlugin (InitPluginProtocol , SlotsBase , Generic [ ConfigT ] ):
2023 """Oracledb plugin."""
2124
2225 __slots__ = ()
2326
24- def __init__ (self , config : SyncDatabaseConfig | AsyncDatabaseConfig ) -> None :
27+ def __init__ (self , config : ConfigT ) -> None :
2528 """Initialize ``oracledb``.
2629
2730 Args:
@@ -30,7 +33,7 @@ def __init__(self, config: SyncDatabaseConfig | AsyncDatabaseConfig) -> None:
3033 self ._config = config
3134
3235 @property
33- def config (self ) -> SyncDatabaseConfig | AsyncDatabaseConfig :
36+ def config (self ) -> ConfigT :
3437 """Return the plugin config.
3538
3639 Returns:
You can’t perform that action at this time.
0 commit comments