class documentation

class AppenderQuery(AppenderMixin[_T], Query[_T]): (source)

View In Hierarchy

A dynamic query that supports basic collection storage operations. Methods on :class:`.AppenderQuery` include all methods of :class:`_orm.Query`, plus additional methods used for collection persistence.

Inherited from AppenderMixin:

Method __getitem__ Undocumented
Method __init__ Undocumented
Method __iter__ Undocumented
Method add Add an item to this :class:`_orm.AppenderQuery`.
Method add_all Add an iterable of items to this :class:`_orm.AppenderQuery`.
Method append Append an item to this :class:`_orm.AppenderQuery`.
Method count Undocumented
Method extend Add an iterable of items to this :class:`_orm.AppenderQuery`.
Method remove Remove an item from this :class:`_orm.AppenderQuery`.
Method session.setter Undocumented
Class Variable query_class Undocumented
Instance Variable sess Undocumented
Property session Undocumented
Method _generate Undocumented
Method _iter Undocumented

Inherited from AbstractCollectionWriter (via AppenderMixin):

Class Variable __slots__ Undocumented
Instance Variable attr Undocumented
Instance Variable instance Undocumented
Method _add_all_impl Undocumented
Method _remove_impl Undocumented
Instance Variable _from_obj Undocumented
Instance Variable _order_by_clauses Undocumented
Instance Variable _where_criteria Undocumented

Inherited from Query (via AppenderMixin, AbstractCollectionWriter):

Method __clause_element__ Undocumented
Method __str__ Undocumented
Method add_column Add a column expression to the list of result columns to be returned.
Method add_columns Add one or more column expressions to the list of result columns to be returned.
Method add_entity add a mapped entity to the list of result columns to be returned.
Method all Return the results represented by this :class:`_query.Query` as a list.
Method as_scalar Return the full SELECT statement represented by this :class:`_query.Query`, converted to a scalar subquery.
Method autoflush Return a Query with a specific 'autoflush' setting.
Method correlate Return a :class:`.Query` construct which will correlate the given FROM clauses to that of an enclosing :class:`.Query` or :func:`~.expression.select`.
Method cte Return the full SELECT statement represented by this :class:`_query.Query` represented as a common table expression (CTE).
Method delete Perform a DELETE with an arbitrary WHERE clause.
Method distinct Apply a ``DISTINCT`` to the query and return the newly resulting ``Query``.
Method enable_assertions Control whether assertions are generated.
Method enable_eagerloads Control whether or not eager joins and subqueries are rendered.
Method except_ Produce an EXCEPT of this Query against one or more queries.
Method except_all Produce an EXCEPT ALL of this Query against one or more queries.
Method execution_options Set non-SQL options which take effect during execution.
Method exists A convenience method that turns a query into an EXISTS subquery of the form EXISTS (SELECT 1 FROM ... WHERE ...).
Method filter Apply the given filtering criterion to a copy of this :class:`_query.Query`, using SQL expressions.
Method filter_by Apply the given filtering criterion to a copy of this :class:`_query.Query`, using keyword expressions.
Method first Return the first result of this ``Query`` or None if the result doesn't contain any row.
Method from_statement Execute the given SELECT statement and return results.
Method get Return an instance based on the given primary key identifier, or ``None`` if not found.
Method get_execution_options Get the non-SQL options which will take effect during execution.
Method group_by Apply one or more GROUP BY criterion to the query and return the newly resulting :class:`_query.Query`.
Method having Apply a HAVING criterion to the query and return the newly resulting :class:`_query.Query`.
Method instances Return an ORM result given a :class:`_engine.CursorResult` and :class:`.QueryContext`.
Method intersect Produce an INTERSECT of this Query against one or more queries.
Method intersect_all Produce an INTERSECT ALL of this Query against one or more queries.
Method join Create a SQL JOIN against this :class:`_query.Query` object's criterion and apply generatively, returning the newly resulting :class:`_query.Query`.
Method label Return the full SELECT statement represented by this :class:`_query.Query`, converted to a scalar subquery with a label of the given name.
Method limit Apply a ``LIMIT`` to the query and return the newly resulting ``Query``.
Method merge_result Merge a result into this :class:`_query.Query` object's Session.
Method offset Apply an ``OFFSET`` to the query and return the newly resulting ``Query``.
Method one Return exactly one result or raise an exception.
Method one_or_none Return at most one result or raise an exception.
Method only_return_tuples When set to True, the query results will always be a :class:`.Row` object.
Method options Return a new :class:`_query.Query` object, applying the given list of mapper options.
Method order_by Apply one or more ORDER BY criteria to the query and return the newly resulting :class:`_query.Query`.
Method outerjoin Create a left outer join against this ``Query`` object's criterion and apply generatively, returning the newly resulting ``Query``.
Method params Add values for bind parameters which may have been specified in filter().
Method populate_existing Return a :class:`_query.Query` that will expire and refresh all instances as they are loaded, or reused from the current :class:`.Session`.
Method reset_joinpoint Return a new :class:`.Query`, where the "join point" has been reset back to the base FROM entities of the query.
Method scalar Return the first element of the first result or None if no rows present. If multiple rows are returned, raises MultipleResultsFound.
Method scalar_subquery Return the full SELECT statement represented by this :class:`_query.Query`, converted to a scalar subquery.
Method select_from Set the FROM clause of this :class:`.Query` explicitly.
Method set_label_style Apply column labels to the return value of Query.statement.
Method slice Computes the "slice" of the :class:`_query.Query` represented by the given indices and returns the resulting :class:`_query.Query`.
Method subquery Return the full SELECT statement represented by this :class:`_query.Query`, embedded within an :class:`_expression.Alias`.
Method tuples return a tuple-typed form of this :class:`.Query`.
Method union Produce a UNION of this Query against one or more queries.
Method union_all Produce a UNION ALL of this Query against one or more queries.
Method update Perform an UPDATE with an arbitrary WHERE clause.
Method value Return a scalar result corresponding to the given column expression.
Method values Return an iterator yielding result tuples corresponding to the given list of columns
Method where A synonym for :meth:`.Query.filter`.
Method with_entities Return a new :class:`_query.Query` replacing the SELECT list with the given entities.
Method with_for_update return a new :class:`_query.Query` with the specified options for the ``FOR UPDATE`` clause.
Method with_labels Undocumented
Method with_parent Add filtering criterion that relates the given instance to a child object or collection, using its attribute state as well as an established :func:`_orm.relationship()` configuration.
Method with_session Return a :class:`_query.Query` that will use the given :class:`.Session`.
Method with_transformation Return a new :class:`_query.Query` object transformed by the given function.
Method yield_per Yield only ``count`` rows at a time.
Class Variable dispatch Undocumented
Class Variable load_options Undocumented
Property column_descriptions Return metadata about the columns which would be returned by this :class:`_query.Query`.
Property get_label_style Retrieve the current label style.
Property is_single_entity Indicates if this :class:`_query.Query` returns tuples or single entities.
Property lazy_loaded_from An :class:`.InstanceState` that is using this :class:`_query.Query` for a lazy load operation.
Property selectable Return the :class:`_expression.Select` object emitted by this :class:`_query.Query`.
Property statement The full SELECT statement represented by this Query.
Property whereclause A readonly attribute which returns the current WHERE criterion for this Query.
Method _clone clone this element
Method _compile_context Undocumented
Method _compile_state Create an out-of-compiler ORMCompileState object.
Method _entity_from_pre_ent_zero Undocumented
Method _filter_by_zero for the filter_by() method, return the target entity for which we will attempt to derive an expression from based on string name.
Method _final_statement Return the 'final' SELECT statement for this :class:`.Query`.
Method _from_selectable Undocumented
Method _get_bind_args Undocumented
Method _get_condition used by legacy BakedQuery
Method _get_existing_condition Undocumented
Method _get_impl Undocumented
Method _get_options Undocumented
Method _get_select_statement_only Undocumented
Method _legacy_from_self Undocumented
Method _no_clauseelement_condition Undocumented
Method _no_criterion_assertion Undocumented
Method _no_criterion_condition Undocumented
Method _no_limit_offset Undocumented
Method _no_statement_condition Undocumented
Method _only_full_mapper_zero Undocumented
Method _set_enable_single_crit Undocumented
Method _set_entities Undocumented
Method _set_lazyload_from Undocumented
Method _set_op Undocumented
Method _set_propagate_attrs Undocumented
Method _set_select_from Undocumented
Method _statement_20 Undocumented
Method _with_compile_options Undocumented
Method _with_current_path indicate that this query applies to objects loaded within a certain path.
Method _with_invoke_all_eagers Set the 'invoke all eagers' flag which causes joined- and subquery loaders to traverse into already-loaded related objects and collections.
Class Variable _having_criteria Undocumented
Class Variable _memoized_select_entities Undocumented
Class Variable _with_options Undocumented
Instance Variable _auto_correlate Undocumented
Instance Variable _correlate Undocumented
Instance Variable _distinct Undocumented
Instance Variable _distinct_on Undocumented
Instance Variable _enable_assertions Undocumented
Instance Variable _execution_options Undocumented
Instance Variable _for_update_arg Undocumented
Instance Variable _group_by_clauses Undocumented
Instance Variable _label_style Undocumented
Instance Variable _last_joined_entity Undocumented
Instance Variable _limit_clause Undocumented
Instance Variable _offset_clause Undocumented
Instance Variable _params Undocumented
Instance Variable _propagate_attrs Undocumented
Instance Variable _raw_columns Undocumented
Instance Variable _setup_joins Undocumented
Instance Variable _statement Undocumented
Property _current_path Undocumented
Property _has_row_limiting_clause Undocumented

Inherited from _SelectFromElements (via AppenderMixin, AbstractCollectionWriter, Query):

Method _iterate_from_elements Undocumented

Inherited from SupportsCloneAnnotations (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements):

Method _annotate return a copy of this ClauseElement with annotations updated by the given dictionary.
Method _deannotate return a copy of this :class:`_expression.ClauseElement` with annotations removed.
Method _with_annotations return a copy of this ClauseElement with annotations replaced by the given dictionary.
Class Variable _clone_annotations_traverse_internals Undocumented

Inherited from SupportsWrappingAnnotations (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations):

Property entity_namespace Undocumented
Class Variable _constructor Undocumented

Inherited from SupportsAnnotations (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations):

Class Variable proxy_set Undocumented
Method _gen_annotations_cache_key Undocumented
Class Variable _is_immutable Undocumented
Property _annotations_cache_key Undocumented

Inherited from ExternallyTraversible (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations):

Method get_children Return immediate child :class:`.visitors.HasTraverseInternals` elements of this :class:`.visitors.HasTraverseInternals`.
Method _copy_internals Reassign internal elements to be clones of themselves.

Inherited from HasTraverseInternals (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations, ExternallyTraversible):

Class Variable _traverse_internals Undocumented

Inherited from Visitable (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations, ExternallyTraversible, HasTraverseInternals):

Method __class_getitem__ Undocumented
Method __init_subclass__ Undocumented
Class Variable __visit_name__ Undocumented
Class Method _generate_compiler_dispatch Undocumented
Method _compiler_dispatch Undocumented
Class Variable _original_compiler_dispatch Undocumented

Inherited from HasPrefixes (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations, ExternallyTraversible, HasTraverseInternals, Visitable):

Method prefix_with Add one or more expressions following the statement keyword, i.e. SELECT, INSERT, UPDATE, or DELETE. Generative.
Class Variable _has_prefixes_traverse_internals Undocumented
Instance Variable _prefixes Undocumented

Inherited from HasSuffixes (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations, ExternallyTraversible, HasTraverseInternals, Visitable, HasPrefixes):

Method suffix_with Add one or more expressions following the statement as a whole.
Class Variable _has_suffixes_traverse_internals Undocumented
Instance Variable _suffixes Undocumented

Inherited from HasHints (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations, ExternallyTraversible, HasTraverseInternals, Visitable, HasPrefixes, HasSuffixes):

Method with_hint Add an indexing or other executional context hint for the given selectable to this :class:`_expression.Select` or other selectable object.
Method with_statement_hint Add a statement hint to this :class:`_expression.Select` or other selectable object.
Method _with_hint Undocumented
Class Variable _has_hints_traverse_internals Undocumented
Class Variable _hints Undocumented
Class Variable _statement_hints Undocumented

Inherited from Identified (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations, ExternallyTraversible, HasTraverseInternals, Visitable, HasPrefixes, HasSuffixes, HasHints):

Class Variable logger Undocumented
Class Variable logging_name Undocumented
Method _should_log_debug Undocumented
Method _should_log_info Undocumented
Class Variable _echo Undocumented

Inherited from Executable (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations, ExternallyTraversible, HasTraverseInternals, Visitable, HasPrefixes, HasSuffixes, HasHints, Identified, Generative):

Class Variable is_delete Undocumented
Class Variable is_dml Undocumented
Class Variable is_insert Undocumented
Class Variable is_select Undocumented
Class Variable is_text Undocumented
Class Variable is_update Undocumented
Class Variable supports_execution Undocumented
Method _add_context_option Add a context option to this statement.
Method _compile_w_cache Undocumented
Method _execute_on_connection Undocumented
Method _execute_on_scalar Undocumented
Method _set_compile_options Assign the compile options to a new value.
Method _update_compile_options update the _compile_options with new keys.
Class Variable _executable_traverse_internals Undocumented
Class Variable _is_default_generator Undocumented
Class Variable _with_context_options Undocumented
Instance Variable _compile_options Undocumented
Property _all_selected_columns Undocumented
Property _effective_plugin_target Undocumented

Inherited from StatementRole (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations, ExternallyTraversible, HasTraverseInternals, Visitable, HasPrefixes, HasSuffixes, HasHints, Identified, Generative, Executable):

Class Variable _role_name Undocumented

Inherited from SQLRole (via AppenderMixin, AbstractCollectionWriter, Query, _SelectFromElements, SupportsCloneAnnotations, SupportsWrappingAnnotations, SupportsAnnotations, ExternallyTraversible, HasTraverseInternals, Visitable, HasPrefixes, HasSuffixes, HasHints, Identified, Generative, Executable, StatementRole):

Class Variable allows_lambda Undocumented
Class Variable uses_inspection Undocumented