MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / _load_on_ident

Function _load_on_ident

lib/sqlalchemy/orm/loading.py:496–532  ·  view source on GitHub ↗

Load the given identity key from the database.

(
    session: Session,
    statement: Union[Select, FromStatement],
    key: Optional[_IdentityKeyType],
    *,
    load_options: Optional[Sequence[ORMOption]] = None,
    refresh_state: Optional[InstanceState[Any]] = None,
    with_for_update: Optional[ForUpdateArg] = None,
    only_load_props: Optional[Iterable[str]] = None,
    no_autoflush: bool = False,
    bind_arguments: Mapping[str, Any] = util.EMPTY_DICT,
    execution_options: _ExecuteOptions = util.EMPTY_DICT,
    require_pk_cols: bool = False,
    is_user_refresh: bool = False,
)

Source from the content-addressed store, hash-verified

494
495
496def _load_on_ident(
497 session: Session,
498 statement: Union[Select, FromStatement],
499 key: Optional[_IdentityKeyType],
500 *,
501 load_options: Optional[Sequence[ORMOption]] = None,
502 refresh_state: Optional[InstanceState[Any]] = None,
503 with_for_update: Optional[ForUpdateArg] = None,
504 only_load_props: Optional[Iterable[str]] = None,
505 no_autoflush: bool = False,
506 bind_arguments: Mapping[str, Any] = util.EMPTY_DICT,
507 execution_options: _ExecuteOptions = util.EMPTY_DICT,
508 require_pk_cols: bool = False,
509 is_user_refresh: bool = False,
510):
511 """Load the given identity key from the database."""
512 if key is not None:
513 ident = key[1]
514 identity_token = key[2]
515 else:
516 ident = identity_token = None
517
518 return _load_on_pk_identity(
519 session,
520 statement,
521 ident,
522 load_options=load_options,
523 refresh_state=refresh_state,
524 with_for_update=with_for_update,
525 only_load_props=only_load_props,
526 identity_token=identity_token,
527 no_autoflush=no_autoflush,
528 bind_arguments=bind_arguments,
529 execution_options=execution_options,
530 require_pk_cols=require_pk_cols,
531 is_user_refresh=is_user_refresh,
532 )
533
534
535def _load_on_pk_identity(

Callers 1

_load_scalar_attributesFunction · 0.85

Calls 1

_load_on_pk_identityFunction · 0.85

Tested by

no test coverage detected