@@ -36,9 +36,17 @@ class _ConnectionCallable(Protocol[_T_contra, _T_co]):
3636 self , __connection : _T_contra , * args : Any , ** kwargs : Any
3737 ) -> _T_co : ...
3838
39- class Connection (Connectable ):
40- engine : Engine = ...
39+ class _ConnectionTypingCommon :
40+ @property
41+ def closed (self ) -> bool : ...
42+ @property
43+ def invalidated (self ) -> bool : ...
4144 dialect : Dialect = ...
45+ @property
46+ def default_isolation_level (self ) -> Any : ...
47+
48+ class Connection (_ConnectionTypingCommon , Connectable ):
49+ engine : Engine = ...
4250 should_close_with_result : bool = ...
4351 dispatch : Any = ...
4452 def __init__ (
@@ -57,15 +65,9 @@ class Connection(Connectable):
5765 def execution_options (self : _TConnection , ** opt : Any ) -> _TConnection : ...
5866 def get_execution_options (self ) -> Dict [str , Any ]: ...
5967 @property
60- def closed (self ) -> bool : ...
61- @property
62- def invalidated (self ) -> bool : ...
63- @property
6468 def connection (self ) -> _DBAPIConnection : ...
6569 def get_isolation_level (self ) -> Any : ...
6670 @property
67- def default_isolation_level (self ) -> Any : ...
68- @property
6971 def info (self ) -> MutableMapping [Any , Any ]: ...
7072 def connect (self : _TConnection , close_with_result : bool = ...) -> _TConnection : ... # type: ignore[override]
7173 def invalidate (self , exception : Optional [Any ] = ...) -> None : ...
@@ -161,13 +163,25 @@ class TwoPhaseTransaction(RootTransaction):
161163 def __init__ (self , connection : Connection , xid : str ) -> None : ...
162164 def prepare (self ) -> None : ...
163165
164- class Engine ( Connectable , log . Identified ) :
166+ class _EngineTypingCommon :
165167 pool : Pool = ...
166168 url : URL = ...
167169 dialect : Dialect = ...
168170 logging_name : Optional [str ] = ...
169171 echo : Optional [Union [bool , Literal ["debug" ]]] = ...
170172 hide_parameters : bool = ...
173+ @property
174+ def name (self ) -> str : ...
175+ @property
176+ def driver (self ) -> str : ...
177+ def clear_compiled_cache (self ) -> None : ...
178+ def update_execution_options (self , ** opt : Any ) -> None : ...
179+ def get_execution_options (self ) -> Dict [str , Any ]: ...
180+
181+ class Engine (_EngineTypingCommon , Connectable , log .Identified ):
182+ @property
183+ def engine (self : _TEngine ) -> _TEngine : ...
184+ hide_parameters : bool = ...
171185 def __init__ (
172186 self ,
173187 pool : Pool ,
@@ -179,16 +193,7 @@ class Engine(Connectable, log.Identified):
179193 execution_options : Optional [Dict [str , Any ]] = ...,
180194 hide_parameters : bool = ...,
181195 ) -> None : ...
182- @property
183- def engine (self : _TEngine ) -> _TEngine : ... # type: ignore[override]
184- def clear_compiled_cache (self ) -> None : ...
185- def update_execution_options (self , ** opt : Any ) -> None : ...
186196 def execution_options (self , ** opt : Any ) -> OptionEngine : ...
187- def get_execution_options (self ) -> Dict [str , Any ]: ...
188- @property
189- def name (self ) -> str : ...
190- @property
191- def driver (self ) -> str : ...
192197 def dispose (self ) -> None : ...
193198 class _trans_ctx :
194199 conn : Connection = ...
0 commit comments