class documentation

Class-level methods for :class:`.Session`, :class:`.sessionmaker`.

Class Method close_all Close *all* sessions in memory.
Class Method identity_key Return an identity key.
Class Method object_session Return the :class:`.Session` to which an object belongs.
@classmethod
@util.deprecated('1.3', 'The :meth:`.Session.close_all` method is deprecated and will be removed in a future release. Please refer to :func:`.session.close_all_sessions`.')
def close_all(cls): (source)

Close *all* sessions in memory.

@classmethod
@util.preload_module('sqlalchemy.orm.util')
def identity_key(cls, class_: Optional[Type[Any]] = None, ident: Union[Any, Tuple[Any, ...]] = None, *, instance: Optional[Any] = None, row: Optional[Union[Row[Any], RowMapping]] = None, identity_token: Optional[Any] = None) -> _IdentityKeyType[Any]: (source)

Return an identity key. This is an alias of :func:`.util.identity_key`.

@classmethod
def object_session(cls, instance: object) -> Optional[Session]: (source)

Return the :class:`.Session` to which an object belongs. This is an alias of :func:`.object_session`.