module documentation

private module containing functions used to convert database rows into object instances and associated state.

the functions here are called primarily by Query, Mapper, as well as some of the attribute loading strategies.

Class ​Post​Load Track loaders and states for "post load" operations.
Function ​_decorate​_polymorphic​_switch Undocumented
Function ​_instance​_processor Produce a mapper level row processor callable which processes rows into mapped instances.
Function ​_load​_subclass​_via​_in Undocumented
Function ​_populate​_full Undocumented
Function ​_populate​_partial Undocumented
Function ​_set​_get​_options Undocumented
Function ​_setup​_entity​_query Undocumented
Function ​_validate​_version​_id Undocumented
Function ​_warn​_for​_runid​_changed Undocumented
Function get​_from​_identity Look up the given key in the given session's identity map, check the object for expired state if found.
Function instances Return a .Result given an ORM query context.
Function load​_on​_ident Load the given identity key from the database.
Function load​_on​_pk​_identity Load the given primary key identity from the database.
Function load​_scalar​_attributes initiate a column-based attribute refresh operation.
Function merge​_frozen​_result Merge a _engine.FrozenResult back into a _orm.Session, returning a new _engine.Result object with :term:`persistent` objects.
Function merge​_result Merge a result into the given .Query object's Session.
Variable ​_new​_runid Undocumented
def _decorate_polymorphic_switch(instance_fn, context, query_entity, mapper, result, path, polymorphic_discriminator, adapter, ensure_no_pk):

Undocumented

def _instance_processor(query_entity, mapper, context, result, path, adapter, only_load_props=None, refresh_state=None, polymorphic_discriminator=None, _polymorphic_from=None):
Produce a mapper level row processor callable which processes rows into mapped instances.
def _load_subclass_via_in(context, path, entity):

Undocumented

def _populate_full(context, row, state, dict_, isnew, load_path, loaded_instance, populate_existing, populators):

Undocumented

def _populate_partial(context, row, state, dict_, isnew, load_path, unloaded, populators):

Undocumented

def _set_get_options(compile_opt, load_opt, populate_existing=None, version_check=None, only_load_props=None, refresh_state=None, identity_token=None):

Undocumented

def _setup_entity_query(compile_state, mapper, query_entity, path, adapter, column_collection, with_polymorphic=None, only_load_props=None, polymorphic_discriminator=None, **kw):

Undocumented

def _validate_version_id(mapper, state, dict_, row, getter):

Undocumented

def _warn_for_runid_changed(state):

Undocumented

def get_from_identity(session, mapper, key, passive):
Look up the given key in the given session's identity map, check the object for expired state if found.
def instances(cursor, context):

Return a .Result given an ORM query context.

Changed in version 1.4: The instances() function now uses .Result objects and has an all new interface.
Parameters
cursora .CursorResult, generated by a statement which came from .ORMCompileState
contexta .QueryContext object
Returns
a .Result object representing ORM results
def load_on_ident(session, statement, key, load_options=None, refresh_state=None, with_for_update=None, only_load_props=None, no_autoflush=False, bind_arguments=util.EMPTY_DICT, execution_options=util.EMPTY_DICT):
Load the given identity key from the database.
def load_on_pk_identity(session, statement, primary_key_identity, load_options=None, refresh_state=None, with_for_update=None, only_load_props=None, identity_token=None, no_autoflush=False, bind_arguments=util.EMPTY_DICT, execution_options=util.EMPTY_DICT):
Load the given primary key identity from the database.
def load_scalar_attributes(mapper, state, attribute_names, passive):
initiate a column-based attribute refresh operation.
@util.preload_module('sqlalchemy.orm.context')
def merge_frozen_result(session, statement, frozen_result, load=True):

Merge a _engine.FrozenResult back into a _orm.Session, returning a new _engine.Result object with :term:`persistent` objects.

See the section :ref:`do_orm_execute_re_executing` for an example.

See Also

:ref:`do_orm_execute_re_executing`

_engine.Result.freeze

_engine.FrozenResult

@util.deprecated_20(':func:`_orm.merge_result`', alternative='The function as well as the method on :class:`_orm.Query` is superseded by the :func:`_orm.merge_frozen_result` function.', becomes_legacy=True)
@util.preload_module('sqlalchemy.orm.context')
def merge_result(query, iterator, load=True):

Merge a result into the given .Query object's Session.

See _orm.Query.merge_result for top-level documentation on this function.

_new_runid =

Undocumented