MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / identity_key_from_primary_key

Method identity_key_from_primary_key

lib/sqlalchemy/orm/mapper.py:3446–3461  ·  view source on GitHub ↗

Return an identity-map key for use in storing/retrieving an item from an identity map. :param primary_key: A list of values indicating the identifier.

(
        self,
        primary_key: Tuple[Any, ...],
        identity_token: Optional[Any] = None,
    )

Source from the content-addressed store, hash-verified

3444 )
3445
3446 def identity_key_from_primary_key(
3447 self,
3448 primary_key: Tuple[Any, ...],
3449 identity_token: Optional[Any] = None,
3450 ) -> _IdentityKeyType[_O]:
3451 """Return an identity-map key for use in storing/retrieving an
3452 item from an identity map.
3453
3454 :param primary_key: A list of values indicating the identifier.
3455
3456 """
3457 return (
3458 self._identity_class,
3459 tuple(primary_key),
3460 identity_token,
3461 )
3462
3463 def identity_key_from_instance(self, instance: _O) -> _IdentityKeyType[_O]:
3464 """Return the identity key for the given instance, based on

Callers 5

identity_keyFunction · 0.80
_identity_lookupMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected