class documentation

class ORMSelectCompileState(ORMCompileState, SelectState):

View In Hierarchy

Undocumented

Class Method all​_selected​_columns Undocumented
Class Method create​_for​_statement compiler hook, we arrive here from compiler.visit_select() only.
Class Method determine​_last​_joined​_entity Undocumented
Class Method from​_statement Undocumented
Class Method get​_columns​_clause​_froms Undocumented
Class Method ​_create​_entities​_collection Creates a partial ORMSelectCompileState that includes the full collection of _MapperEntity and other _QueryEntity objects.
Method ​_adapt​_aliased​_generation Undocumented
Method ​_adapt​_col​_list Undocumented
Method ​_adapt​_polymorphic​_element Undocumented
Method ​_adjust​_for​_extra​_criteria Apply extra criteria filtering.
Method ​_all​_equivs Undocumented
Method ​_compound​_eager​_statement Undocumented
Method ​_entity​_zero Return the 'entity' (mapper or AliasedClass) associated with the first QueryEntity, or alternatively the 'select from' entity if specified.
Method ​_get​_current​_adapter Undocumented
Method ​_get​_extra​_criteria Undocumented
Method ​_get​_select​_from​_alias​_from​_obj Undocumented
Method ​_join Undocumented
Method ​_join​_check​_and​_adapt​_right​_side No summary
Method ​_join​_determine​_implicit​_left​_side When join conditions don't express the left side explicitly, determine if an existing FROM or entity in this query can serve as the left hand side.
Method ​_join​_left​_to​_right given raw "left", "right", "onclause" parameters consumed from a particular key within _join(), add a real ORMJoin object to our _from_obj list (or augment an existing one)
Method ​_join​_place​_explicit​_left​_side No summary
Method ​_joinpoint​_zero Undocumented
Method ​_legacy​_join consumes arguments from join() or outerjoin(), places them into a consistent format with which to form the actual JOIN constructs.
Method ​_mapper​_zero return the Mapper associated with the first QueryEntity.
Method ​_only​_entity​_zero Undocumented
Method ​_only​_full​_mapper​_zero Undocumented
Method ​_reset​_joinpoint Undocumented
Method ​_select​_statement Undocumented
Method ​_set​_select​_from​_alias Undocumented
Method ​_setup​_for​_generate Undocumented
Method ​_setup​_with​_polymorphics Undocumented
Method ​_simple​_statement Undocumented
Method ​_update​_joinpoint Undocumented
Class Variable ​_has​_mapper​_entities Undocumented
Class Variable ​_has​_orm​_entities Undocumented
Class Variable correlate​_except Undocumented
Class Variable multi​_row​_eager​_loaders Undocumented
Instance Variable ​_aliased​_generations Undocumented
Instance Variable ​_entities Undocumented
Instance Variable ​_fallback​_from​_clauses Undocumented
Instance Variable ​_for​_update​_arg Undocumented
Instance Variable ​_from​_obj​_alias Undocumented
Instance Variable ​_having​_criteria Undocumented
Instance Variable ​_join​_entities Undocumented
Instance Variable ​_joinpath Undocumented
Instance Variable ​_joinpoint Undocumented
Instance Variable ​_label​_convention Undocumented
Instance Variable ​_memoized​_entities Undocumented
Instance Variable ​_no​_yield​_pers Undocumented
Instance Variable ​_polymorphic​_adapters Undocumented
Instance Variable ​_primary​_entity Undocumented
Instance Variable ​_where​_criteria Undocumented
Instance Variable ​_with​_polymorphic​_adapt​_map Undocumented
Instance Variable attributes Undocumented
Instance Variable compile​_options Undocumented
Instance Variable compound​_eager​_adapter Undocumented
Instance Variable correlate Undocumented
Instance Variable create​_eager​_joins Undocumented
Instance Variable current​_path Undocumented
Instance Variable dedupe​_columns Undocumented
Instance Variable distinct Undocumented
Instance Variable distinct​_on Undocumented
Instance Variable eager​_joins Undocumented
Instance Variable eager​_order​_by Undocumented
Instance Variable extra​_criteria​_entities Undocumented
Instance Variable for​_statement Undocumented
Instance Variable from​_clauses Undocumented
Instance Variable global​_attributes Undocumented
Instance Variable group​_by Undocumented
Instance Variable label​_style Undocumented
Instance Variable order​_by Undocumented
Instance Variable primary​_columns Undocumented
Instance Variable secondary​_columns Undocumented
Instance Variable select​_statement Undocumented
Instance Variable statement Undocumented
Instance Variable use​_legacy​_query​_style Undocumented
Property ​_select​_args Undocumented
Property ​_should​_nest​_selectable Undocumented

Inherited from ORMCompileState:

Class Method get​_column​_descriptions Undocumented
Class Method orm​_pre​_session​_exec Undocumented
Class Method orm​_setup​_cursor​_result Undocumented
Class default​_compile​_options Undocumented
Class Method ​_column​_naming​_convention Undocumented
Method __init__ Undocumented
Method ​_append​_dedupe​_col​_collection Undocumented
Method ​_create​_with​_polymorphic​_adapter Undocumented
Method ​_mapper​_loads​_polymorphically​_with Undocumented
Property ​_lead​_mapper​_entities return all _MapperEntity objects in the lead entities collection.

Inherited from CompileState (via ORMCompileState):

Class Method get​_plugin​_class Undocumented
Class Method plugin​_for Undocumented
Class Method ​_get​_plugin​_class​_for​_plugin Undocumented
Class Variable __slots__ Undocumented
Class Variable plugins Undocumented

Inherited from SelectState:

Class Method get​_column​_descriptions Undocumented
Class default​_select​_compile​_options Undocumented
Class Method ​_column​_naming​_convention Undocumented
Class Method ​_normalize​_froms given an iterable of things to select FROM, reduce them to what would actually render in the FROM clause of a SELECT.
Class Method ​_plugin​_not​_implemented Undocumented
Method __init__ Undocumented
Method ​_get​_display​_froms Return the full list of 'from' clauses to be displayed.
Method ​_get​_froms Undocumented
Method ​_memoized​_attr​_​_label​_resolve​_dict Undocumented
Method ​_setup​_joins Undocumented
Class Variable __slots__ Undocumented
Instance Variable columns​_plus​_names Undocumented
Instance Variable froms Undocumented

Inherited from MemoizedSlots (via SelectState):

Method __getattr__ Undocumented
Method ​_fallback​_getattr Undocumented

Inherited from CompileState (via SelectState):

Class Method get​_plugin​_class Undocumented
Class Method plugin​_for Undocumented
Class Method ​_get​_plugin​_class​_for​_plugin Undocumented
Class Variable plugins Undocumented
@classmethod
def all_selected_columns(cls, statement):
@classmethod
def create_for_statement(cls, statement, compiler, **kw):
compiler hook, we arrive here from compiler.visit_select() only.
@classmethod
def determine_last_joined_entity(cls, statement):
@classmethod
@util.preload_module('sqlalchemy.orm.query')
def from_statement(cls, statement, from_statement):
@classmethod
def get_columns_clause_froms(cls, statement):
@classmethod
def _create_entities_collection(cls, query, legacy):

Creates a partial ORMSelectCompileState that includes the full collection of _MapperEntity and other _QueryEntity objects.

Supports a few remaining use cases that are pre-compilation but still need to gather some of the column / adaption information.

def _adapt_aliased_generation(self, element):

Undocumented

def _adapt_col_list(self, cols, current_adapter):

Undocumented

def _adapt_polymorphic_element(self, element):

Undocumented

def _adjust_for_extra_criteria(self):

Apply extra criteria filtering.

For all distinct single-table-inheritance mappers represented in the columns clause of this query, as well as the "select from entity", add criterion to the WHERE clause of the given QueryContext such that only the appropriate subtypes are selected from the total results.

Additionally, add WHERE criteria originating from LoaderCriteriaOptions associated with the global context.

def _all_equivs(self):

Undocumented

def _compound_eager_statement(self):

Undocumented

def _entity_zero(self):
Return the 'entity' (mapper or AliasedClass) associated with the first QueryEntity, or alternatively the 'select from' entity if specified.
def _get_current_adapter(self):

Undocumented

def _get_extra_criteria(self, ext_info):

Undocumented

def _get_select_from_alias_from_obj(self, from_obj):

Undocumented

def _join(self, args, entities_collection):

Undocumented

def _join_check_and_adapt_right_side(self, left, right, onclause, prop, create_aliases, aliased_generation):
transform the "right" side of the join as well as the onclause according to polymorphic mapping translations, aliasing on the query or on the join, special cases where the right and left side have overlapping tables.
def _join_determine_implicit_left_side(self, entities_collection, left, right, onclause):
When join conditions don't express the left side explicitly, determine if an existing FROM or entity in this query can serve as the left hand side.
def _join_left_to_right(self, entities_collection, left, right, onclause, prop, create_aliases, aliased_generation, outerjoin, full):
given raw "left", "right", "onclause" parameters consumed from a particular key within _join(), add a real ORMJoin object to our _from_obj list (or augment an existing one)
def _join_place_explicit_left_side(self, entities_collection, left):
When join conditions express a left side explicitly, determine where in our existing list of FROM clauses we should join towards, or if we need to make a new join, and if so is it from one of our existing entities.
def _joinpoint_zero(self):

Undocumented

def _legacy_join(self, args, entities_collection):
consumes arguments from join() or outerjoin(), places them into a consistent format with which to form the actual JOIN constructs.
def _mapper_zero(self):
return the Mapper associated with the first QueryEntity.
def _only_entity_zero(self, rationale=None):

Undocumented

def _only_full_mapper_zero(self, methname):

Undocumented

def _reset_joinpoint(self):

Undocumented

def _select_statement(self, raw_columns, from_obj, where_criteria, having_criteria, label_style, order_by, for_update, hints, statement_hints, correlate, correlate_except, limit_clause, offset_clause, distinct, distinct_on, prefixes, suffixes, group_by):

Undocumented

def _set_select_from_alias(self):

Undocumented

def _setup_for_generate(self):

Undocumented

def _setup_with_polymorphics(self):

Undocumented

def _simple_statement(self):

Undocumented

def _update_joinpoint(self, jp):

Undocumented

_has_mapper_entities: bool =

Undocumented

_has_orm_entities: bool =

Undocumented

correlate_except =

Undocumented

multi_row_eager_loaders: bool =

Undocumented

_aliased_generations: dict =

Undocumented

_entities: list =

Undocumented

_fallback_from_clauses: list =

Undocumented

_for_update_arg =

Undocumented

_from_obj_alias =

Undocumented

_having_criteria =

Undocumented

_join_entities: tuple =

Undocumented

_joinpath =

Undocumented

_joinpoint =

Undocumented

_label_convention =

Undocumented

_memoized_entities =

Undocumented

_no_yield_pers: set =

Undocumented

_polymorphic_adapters: dict =

Undocumented

_primary_entity =

Undocumented

_where_criteria =

Undocumented

_with_polymorphic_adapt_map =

Undocumented

attributes: dict[str, set] =

Undocumented

compile_options =

Undocumented

compound_eager_adapter =

Undocumented

correlate =

Undocumented

create_eager_joins: list =

Undocumented

current_path =

Undocumented

dedupe_columns: set =

Undocumented

distinct =

Undocumented

distinct_on =

Undocumented

eager_joins: dict =

Undocumented

eager_order_by =

Undocumented

extra_criteria_entities: dict =

Undocumented

for_statement =

Undocumented

from_clauses =
global_attributes =

Undocumented

group_by =

Undocumented

label_style =

Undocumented

order_by =

Undocumented

primary_columns: list =

Undocumented

secondary_columns: list =

Undocumented

select_statement =

Undocumented

statement =
use_legacy_query_style =

Undocumented

@property
_select_args =

Undocumented

@property
_should_nest_selectable =

Undocumented