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

Function load_on_ident

lib/sqlalchemy/orm/loading.py:488–524  ·  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

486
487
488def load_on_ident(
489 session: Session,
490 statement: Union[Select, FromStatement],
491 key: Optional[_IdentityKeyType],
492 *,
493 load_options: Optional[Sequence[ORMOption]] = None,
494 refresh_state: Optional[InstanceState[Any]] = None,
495 with_for_update: Optional[ForUpdateArg] = None,
496 only_load_props: Optional[Iterable[str]] = None,
497 no_autoflush: bool = False,
498 bind_arguments: Mapping[str, Any] = util.EMPTY_DICT,
499 execution_options: _ExecuteOptions = util.EMPTY_DICT,
500 require_pk_cols: bool = False,
501 is_user_refresh: bool = False,
502):
503 """Load the given identity key from the database."""
504 if key is not None:
505 ident = key[1]
506 identity_token = key[2]
507 else:
508 ident = identity_token = None
509
510 return load_on_pk_identity(
511 session,
512 statement,
513 ident,
514 load_options=load_options,
515 refresh_state=refresh_state,
516 with_for_update=with_for_update,
517 only_load_props=only_load_props,
518 identity_token=identity_token,
519 no_autoflush=no_autoflush,
520 bind_arguments=bind_arguments,
521 execution_options=execution_options,
522 require_pk_cols=require_pk_cols,
523 is_user_refresh=is_user_refresh,
524 )
525
526
527def 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