MCPcopy Create free account
hub / github.com/sqlalchemy/sqlalchemy / connection

Method connection

lib/sqlalchemy/orm/session.py:1034–1041  ·  view source on GitHub ↗
(
        self,
        bindkey: Optional[Mapper[Any]],
        execution_options: Optional[_ExecuteOptions] = None,
        **kwargs: Any,
    )

Source from the content-addressed store, hash-verified

1032 (SessionTransactionState.ACTIVE,), _StateChangeStates.NO_CHANGE
1033 )
1034 def connection(
1035 self,
1036 bindkey: Optional[Mapper[Any]],
1037 execution_options: Optional[_ExecuteOptions] = None,
1038 **kwargs: Any,
1039 ) -> Connection:
1040 bind = self.session.get_bind(bindkey, **kwargs)
1041 return self._connection_for_bind(bind, execution_options)
1042
1043 @_StateChange.declare_states(
1044 (SessionTransactionState.ACTIVE,), _StateChangeStates.NO_CHANGE

Callers

nothing calls this directly

Calls 2

_connection_for_bindMethod · 0.95
get_bindMethod · 0.45

Tested by

no test coverage detected