class documentation

Form the base for ``INSERT``, ``UPDATE``, and ``DELETE`` statements.

Method corresponding_column Undocumented
Method params Set the parameters for the statement.
Method return_defaults Make use of a :term:`RETURNING` clause for the purpose of fetching server-side expressions and defaults, for supporting backends only.
Method returning Add a :term:`RETURNING` or equivalent clause to this statement.
Method with_dialect_options Add dialect options to this INSERT/UPDATE/DELETE object.
Method with_hint Add a table hint for a single table to this INSERT/UPDATE/DELETE statement.
Class Variable __visit_name__ Undocumented
Class Variable is_dml Undocumented
Class Variable named_with_column Undocumented
Class Variable table Undocumented
Property entity_description Return a :term:`plugin-enabled` description of the table and/or entity which this DML construct is operating against.
Property exported_columns Return the RETURNING columns as a column collection for this statement.
Property returning_column_descriptions Return a :term:`plugin-enabled` description of the columns which this DML construct is RETURNING against, in other words the expressions established as part of :meth:`.UpdateBase.returning`.
Method _generate_fromclause_column_proxies Populate columns into an :class:`.AliasedReturnsRows` object.
Class Variable _returning Undocumented
Instance Variable _hints Undocumented
Instance Variable _return_defaults Undocumented
Instance Variable _return_defaults_columns Undocumented
Instance Variable _supplemental_returning Undocumented
Property _all_selected_columns A sequence of column expression objects that represents the "selected" columns of this :class:`_expression.ReturnsRows`.

Inherited from DMLRole:

Class Variable __slots__ Undocumented

Inherited from HasCTE (via DMLRole):

Method add_cte Add one or more :class:`_sql.CTE` constructs to this statement.
Method cte Return a new :class:`_expression.CTE`, or Common Table Expression instance.
Class Variable _has_ctes_traverse_internals Undocumented
Class Variable _independent_ctes Undocumented
Class Variable _independent_ctes_opts Undocumented

Inherited from SelectsRows (via DMLRole, HasCTE, HasCTERole):

Method _generate_columns_plus_names Generate column names as rendered in a SELECT statement by the compiler.

Inherited from HasCompileState (via DMLRole, HasCTE, HasCTERole, SelectsRows):

Class Variable _compile_state_plugin Undocumented

Inherited from DialectKWArgs (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState):

Class Method argument_for Add a new kind of dialect-specific keyword argument for this class.
Property dialect_kwargs A collection of keyword arguments specified as dialect-specific options to this construct.
Property dialect_options A collection of keyword arguments specified as dialect-specific options to this construct.
Property kwargs A synonym for :attr:`.DialectKWArgs.dialect_kwargs`.
Method _kw_reg_for_dialect_cls Undocumented
Method _validate_dialect_kwargs Undocumented
Class Variable _dialect_kwargs_traverse_internals Undocumented
Class Variable _kw_registry Undocumented

Inherited from HasPrefixes (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs):

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 Generative (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes):

Method _generate Undocumented

Inherited from Executable (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows):

Method execution_options Set non-SQL options for the statement which take effect during execution.
Method get_execution_options Get the non-SQL options which will take effect during execution.
Method options Apply options to this statement.
Class Variable is_delete 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
Class Variable _with_options Undocumented
Instance Variable _compile_options Undocumented
Instance Variable _execution_options Undocumented
Property _effective_plugin_target Undocumented

Inherited from StatementRole (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable):

Class Variable _role_name Undocumented
Property _propagate_attrs Undocumented

Inherited from ReturnsRows (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole):

Method is_derived_from Return ``True`` if this :class:`.ReturnsRows` is 'derived' from the given :class:`.FromClause`.
Property selectable Undocumented
Method _refresh_for_new_column reset internal collections for an incoming column being added.
Class Variable _is_from_clause Undocumented
Class Variable _is_lateral Undocumented
Class Variable _is_returns_rows Undocumented
Class Variable _is_select_base Undocumented
Class Variable _is_select_statement Undocumented

Inherited from SQLRole (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole):

Class Variable allows_lambda Undocumented
Class Variable uses_inspection Undocumented

Inherited from DQLDMLClauseElement (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole):

Method compile Compile this SQL expression.
Method _compiler Return a compiler appropriate for this ClauseElement, given a Dialect.

Inherited from ClauseElement (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement):

Method __bool__ Undocumented
Method __getstate__ Undocumented
Method __invert__ Undocumented
Method __repr__ Undocumented
Method compare Compare this :class:`_expression.ClauseElement` to the given :class:`_expression.ClauseElement`.
Method get_children Return immediate child :class:`.visitors.HasTraverseInternals` elements of this :class:`.visitors.HasTraverseInternals`.
Method self_group Apply a 'grouping' to this :class:`_expression.ClauseElement`.
Method unique_params Return a copy with :func:`_expression.bindparam` elements replaced.
Class Variable is_clause_element Undocumented
Class Variable is_selectable Undocumented
Class Variable negation_clause Undocumented
Property description Undocumented
Property entity_namespace Undocumented
Method _clone Create a shallow copy of this ClauseElement.
Method _cloned_set Return the set consisting all cloned ancestors of this ClauseElement.
Method _negate Undocumented
Method _negate_in_binary a hook to allow the right side of a binary expression to respond to a negation of the binary expression.
Method _replace_params Undocumented
Method _set_propagate_attrs Undocumented
Method _ungroup Return this :class:`_expression.ClauseElement` without any groupings.
Method _with_binary_element_type in the context of binary expression, convert the type of this object to the one given.
Class Variable _cache_key_traversal Undocumented
Class Variable _gen_static_annotations_cache_key Undocumented
Class Variable _is_bind_parameter Undocumented
Class Variable _is_clause_list Undocumented
Class Variable _is_clone_of Undocumented
Class Variable _is_column_element Undocumented
Class Variable _is_from_container Undocumented
Class Variable _is_immutable Undocumented
Class Variable _is_keyed_column_element Undocumented
Class Variable _is_lambda_element Undocumented
Class Variable _is_select_container Undocumented
Class Variable _is_singleton_constant Undocumented
Class Variable _is_star Undocumented
Class Variable _is_table Undocumented
Class Variable _is_text_clause Undocumented
Class Variable _is_textual Undocumented
Property _constructor return the 'constructor' for this ClauseElement.
Property _from_objects Undocumented
Property _order_by_label_element Undocumented

Inherited from SupportsWrappingAnnotations (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement):

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.

Inherited from SupportsAnnotations (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations):

Class Variable proxy_set Undocumented
Method _gen_annotations_cache_key Undocumented
Property _annotations_cache_key Undocumented

Inherited from MemoizedHasCacheKey (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations):

Method _generate_cache_key return a cache key.

Inherited from HasCacheKey (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations, MemoizedHasCacheKey):

Class Variable inherit_cache Indicate if this :class:`.HasCacheKey` instance should make use of the cache key generation scheme used by its immediate superclass.
Class Method _generate_cache_attrs generate cache key dispatcher for a new class.
Class Method _generate_cache_key_for_object Undocumented
Method _gen_cache_key return an optional cache key.
Class Variable _generated_cache_key_traversal Undocumented
Class Variable _hierarchy_supports_caching private attribute which may be set to False to prevent the inherit_cache warning from being emitted for a hierarchy of subclasses.
Class Variable _is_has_cache_key Undocumented

Inherited from HasCopyInternals (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations, MemoizedHasCacheKey, HasCacheKey):

Method _copy_internals Reassign internal elements to be clones of themselves.

Inherited from HasTraverseInternals (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations, MemoizedHasCacheKey, HasCacheKey, HasCopyInternals, ExternallyTraversible):

Class Variable _traverse_internals Undocumented

Inherited from CompilerElement (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations, MemoizedHasCacheKey, HasCacheKey, HasCopyInternals, ExternallyTraversible, HasTraverseInternals):

Method __str__ Undocumented
Class Variable stringify_dialect Undocumented

Inherited from Visitable (via DMLRole, HasCTE, HasCTERole, SelectsRows, HasCompileState, DialectKWArgs, HasPrefixes, Generative, ExecutableReturnsRows, Executable, StatementRole, ReturnsRows, ReturnsRowsRole, SQLRole, DQLDMLClauseElement, ClauseElement, SupportsWrappingAnnotations, SupportsAnnotations, MemoizedHasCacheKey, HasCacheKey, HasCopyInternals, ExternallyTraversible, HasTraverseInternals, CompilerElement):

Method __class_getitem__ Undocumented
Method __init_subclass__ Undocumented
Class Method _generate_compiler_dispatch Undocumented
Method _compiler_dispatch Undocumented
Class Variable _original_compiler_dispatch Undocumented
def corresponding_column(self, column: KeyedColumnElement[Any], require_embedded: bool = False) -> Optional[ColumnElement[Any]]: (source)

Undocumented

def params(self, *arg: Any, **kw: Any) -> NoReturn: (source)

Set the parameters for the statement. This method raises ``NotImplementedError`` on the base class, and is overridden by :class:`.ValuesBase` to provide the SET/VALUES clause of UPDATE and INSERT.

@_generative
def return_defaults(self, *cols: _DMLColumnArgument, supplemental_cols: Optional[Iterable[_DMLColumnArgument]] = None) -> Self: (source)

Make use of a :term:`RETURNING` clause for the purpose of fetching server-side expressions and defaults, for supporting backends only. .. deepalchemy:: The :meth:`.UpdateBase.return_defaults` method is used by the ORM for its internal work in fetching newly generated primary key and server default values, in particular to provide the underyling implementation of the :paramref:`_orm.Mapper.eager_defaults` ORM feature as well as to allow RETURNING support with bulk ORM inserts. Its behavior is fairly idiosyncratic and is not really intended for general use. End users should stick with using :meth:`.UpdateBase.returning` in order to add RETURNING clauses to their INSERT, UPDATE and DELETE statements. Normally, a single row INSERT statement will automatically populate the :attr:`.CursorResult.inserted_primary_key` attribute when executed, which stores the primary key of the row that was just inserted in the form of a :class:`.Row` object with column names as named tuple keys (and the :attr:`.Row._mapping` view fully populated as well). The dialect in use chooses the strategy to use in order to populate this data; if it was generated using server-side defaults and / or SQL expressions, dialect-specific approaches such as ``cursor.lastrowid`` or ``RETURNING`` are typically used to acquire the new primary key value. However, when the statement is modified by calling :meth:`.UpdateBase.return_defaults` before executing the statement, additional behaviors take place **only** for backends that support RETURNING and for :class:`.Table` objects that maintain the :paramref:`.Table.implicit_returning` parameter at its default value of ``True``. In these cases, when the :class:`.CursorResult` is returned from the statement's execution, not only will :attr:`.CursorResult.inserted_primary_key` be populated as always, the :attr:`.CursorResult.returned_defaults` attribute will also be populated with a :class:`.Row` named-tuple representing the full range of server generated values from that single row, including values for any columns that specify :paramref:`_schema.Column.server_default` or which make use of :paramref:`_schema.Column.default` using a SQL expression. When invoking INSERT statements with multiple rows using :ref:`insertmanyvalues <engine_insertmanyvalues>`, the :meth:`.UpdateBase.return_defaults` modifier will have the effect of the :attr:`_engine.CursorResult.inserted_primary_key_rows` and :attr:`_engine.CursorResult.returned_defaults_rows` attributes being fully populated with lists of :class:`.Row` objects representing newly inserted primary key values as well as newly inserted server generated values for each row inserted. The :attr:`.CursorResult.inserted_primary_key` and :attr:`.CursorResult.returned_defaults` attributes will also continue to be populated with the first row of these two collections. If the backend does not support RETURNING or the :class:`.Table` in use has disabled :paramref:`.Table.implicit_returning`, then no RETURNING clause is added and no additional data is fetched, however the INSERT, UPDATE or DELETE statement proceeds normally. E.g.:: stmt = table.insert().values(data='newdata').return_defaults() result = connection.execute(stmt) server_created_at = result.returned_defaults['created_at'] When used against an UPDATE statement :meth:`.UpdateBase.return_defaults` instead looks for columns that include :paramref:`_schema.Column.onupdate` or :paramref:`_schema.Column.server_onupdate` parameters assigned, when constructing the columns that will be included in the RETURNING clause by default if explicit columns were not specified. When used against a DELETE statement, no columns are included in RETURNING by default, they instead must be specified explicitly as there are no columns that normally change values when a DELETE statement proceeds. .. versionadded:: 2.0 :meth:`.UpdateBase.return_defaults` is supported for DELETE statements also and has been moved from :class:`.ValuesBase` to :class:`.UpdateBase`. The :meth:`.UpdateBase.return_defaults` method is mutually exclusive against the :meth:`.UpdateBase.returning` method and errors will be raised during the SQL compilation process if both are used at the same time on one statement. The RETURNING clause of the INSERT, UPDATE or DELETE statement is therefore controlled by only one of these methods at a time. The :meth:`.UpdateBase.return_defaults` method differs from :meth:`.UpdateBase.returning` in these ways: 1. :meth:`.UpdateBase.return_defaults` method causes the :attr:`.CursorResult.returned_defaults` collection to be populated with the first row from the RETURNING result. This attribute is not populated when using :meth:`.UpdateBase.returning`. 2. :meth:`.UpdateBase.return_defaults` is compatible with existing logic used to fetch auto-generated primary key values that are then populated into the :attr:`.CursorResult.inserted_primary_key` attribute. By contrast, using :meth:`.UpdateBase.returning` will have the effect of the :attr:`.CursorResult.inserted_primary_key` attribute being left unpopulated. 3. :meth:`.UpdateBase.return_defaults` can be called against any backend. Backends that don't support RETURNING will skip the usage of the feature, rather than raising an exception. The return value of :attr:`_engine.CursorResult.returned_defaults` will be ``None`` for backends that don't support RETURNING or for which the target :class:`.Table` sets :paramref:`.Table.implicit_returning` to ``False``. 4. An INSERT statement invoked with executemany() is supported if the backend database driver supports the :ref:`insertmanyvalues <engine_insertmanyvalues>` feature which is now supported by most SQLAlchemy-included backends. When executemany is used, the :attr:`_engine.CursorResult.returned_defaults_rows` and :attr:`_engine.CursorResult.inserted_primary_key_rows` accessors will return the inserted defaults and primary keys. .. versionadded:: 1.4 Added :attr:`_engine.CursorResult.returned_defaults_rows` and :attr:`_engine.CursorResult.inserted_primary_key_rows` accessors. In version 2.0, the underlying implementation which fetches and populates the data for these attributes was generalized to be supported by most backends, whereas in 1.4 they were only supported by the ``psycopg2`` driver. :param cols: optional list of column key names or :class:`_schema.Column` that acts as a filter for those columns that will be fetched. :param supplemental_cols: optional list of RETURNING expressions, in the same form as one would pass to the :meth:`.UpdateBase.returning` method. When present, the additional columns will be included in the RETURNING clause, and the :class:`.CursorResult` object will be "rewound" when returned, so that methods like :meth:`.CursorResult.all` will return new rows mostly as though the statement used :meth:`.UpdateBase.returning` directly. However, unlike when using :meth:`.UpdateBase.returning` directly, the **order of the columns is undefined**, so can only be targeted using names or :attr:`.Row._mapping` keys; they cannot reliably be targeted positionally. .. versionadded:: 2.0 .. seealso:: :meth:`.UpdateBase.returning` :attr:`_engine.CursorResult.returned_defaults` :attr:`_engine.CursorResult.returned_defaults_rows` :attr:`_engine.CursorResult.inserted_primary_key` :attr:`_engine.CursorResult.inserted_primary_key_rows`

@_generative
def returning(self, *cols: _ColumnsClauseArgument[Any], **__kw: Any) -> UpdateBase: (source)

Add a :term:`RETURNING` or equivalent clause to this statement. e.g.: .. sourcecode:: pycon+sql >>> stmt = ( ... table.update() ... .where(table.c.data == "value") ... .values(status="X") ... .returning(table.c.server_flag, table.c.updated_timestamp) ... ) >>> print(stmt) {printsql}UPDATE some_table SET status=:status WHERE some_table.data = :data_1 RETURNING some_table.server_flag, some_table.updated_timestamp The method may be invoked multiple times to add new entries to the list of expressions to be returned. .. versionadded:: 1.4.0b2 The method may be invoked multiple times to add new entries to the list of expressions to be returned. The given collection of column expressions should be derived from the table that is the target of the INSERT, UPDATE, or DELETE. While :class:`_schema.Column` objects are typical, the elements can also be expressions: .. sourcecode:: pycon+sql >>> stmt = table.insert().returning( ... (table.c.first_name + " " + table.c.last_name).label("fullname") ... ) >>> print(stmt) {printsql}INSERT INTO some_table (first_name, last_name) VALUES (:first_name, :last_name) RETURNING some_table.first_name || :first_name_1 || some_table.last_name AS fullname Upon compilation, a RETURNING clause, or database equivalent, will be rendered within the statement. For INSERT and UPDATE, the values are the newly inserted/updated values. For DELETE, the values are those of the rows which were deleted. Upon execution, the values of the columns to be returned are made available via the result set and can be iterated using :meth:`_engine.CursorResult.fetchone` and similar. For DBAPIs which do not natively support returning values (i.e. cx_oracle), SQLAlchemy will approximate this behavior at the result level so that a reasonable amount of behavioral neutrality is provided. Note that not all databases/DBAPIs support RETURNING. For those backends with no support, an exception is raised upon compilation and/or execution. For those who do support it, the functionality across backends varies greatly, including restrictions on executemany() and other statements which return multiple rows. Please read the documentation notes for the database in use in order to determine the availability of RETURNING. .. seealso:: :meth:`.UpdateBase.return_defaults` - an alternative method tailored towards efficient fetching of server-side defaults and triggers for single-row INSERTs or UPDATEs. :ref:`tutorial_insert_returning` - in the :ref:`unified_tutorial`

@_generative
def with_dialect_options(self, **opt: Any) -> Self: (source)

Add dialect options to this INSERT/UPDATE/DELETE object. e.g.:: upd = table.update().dialect_options(mysql_limit=10) .. versionadded: 1.4 - this method supersedes the dialect options associated with the constructor.

@_generative
def with_hint(self, text: str, selectable: Optional[_DMLTableArgument] = None, dialect_name: str = '*') -> Self: (source)

Add a table hint for a single table to this INSERT/UPDATE/DELETE statement. .. note:: :meth:`.UpdateBase.with_hint` currently applies only to Microsoft SQL Server. For MySQL INSERT/UPDATE/DELETE hints, use :meth:`.UpdateBase.prefix_with`. The text of the hint is rendered in the appropriate location for the database backend in use, relative to the :class:`_schema.Table` that is the subject of this statement, or optionally to that of the given :class:`_schema.Table` passed as the ``selectable`` argument. The ``dialect_name`` option will limit the rendering of a particular hint to a particular backend. Such as, to add a hint that only takes effect for SQL Server:: mytable.insert().with_hint("WITH (PAGLOCK)", dialect_name="mssql") :param text: Text of the hint. :param selectable: optional :class:`_schema.Table` that specifies an element of the FROM clause within an UPDATE or DELETE to be the subject of the hint - applies only to certain backends. :param dialect_name: defaults to ``*``, if specified as the name of a particular dialect, will apply these hints only when that dialect is in use.

named_with_column: bool = (source)

Undocumented

@property
entity_description: Dict[str, Any] = (source)

Return a :term:`plugin-enabled` description of the table and/or entity which this DML construct is operating against. This attribute is generally useful when using the ORM, as an extended structure which includes information about mapped entities is returned. The section :ref:`queryguide_inspection` contains more background. For a Core statement, the structure returned by this accessor is derived from the :attr:`.UpdateBase.table` attribute, and refers to the :class:`.Table` being inserted, updated, or deleted:: >>> stmt = insert(user_table) >>> stmt.entity_description { "name": "user_table", "table": Table("user_table", ...) } .. versionadded:: 1.4.33 .. seealso:: :attr:`.UpdateBase.returning_column_descriptions` :attr:`.Select.column_descriptions` - entity information for a :func:`.select` construct :ref:`queryguide_inspection` - ORM background

@util.ro_memoized_property
exported_columns: ReadOnlyColumnCollection[Optional[str], ColumnElement[Any]] = (source)

Return the RETURNING columns as a column collection for this statement. .. versionadded:: 1.4

@property
returning_column_descriptions: List[Dict[str, Any]] = (source)

Return a :term:`plugin-enabled` description of the columns which this DML construct is RETURNING against, in other words the expressions established as part of :meth:`.UpdateBase.returning`. This attribute is generally useful when using the ORM, as an extended structure which includes information about mapped entities is returned. The section :ref:`queryguide_inspection` contains more background. For a Core statement, the structure returned by this accessor is derived from the same objects that are returned by the :attr:`.UpdateBase.exported_columns` accessor:: >>> stmt = insert(user_table).returning(user_table.c.id, user_table.c.name) >>> stmt.entity_description [ { "name": "id", "type": Integer, "expr": Column("id", Integer(), table=<user>, ...) }, { "name": "name", "type": String(), "expr": Column("name", String(), table=<user>, ...) }, ] .. versionadded:: 1.4.33 .. seealso:: :attr:`.UpdateBase.entity_description` :attr:`.Select.column_descriptions` - entity information for a :func:`.select` construct :ref:`queryguide_inspection` - ORM background

def _generate_fromclause_column_proxies(self, fromclause: FromClause): (source)

Populate columns into an :class:`.AliasedReturnsRows` object.

Undocumented

Undocumented

_return_defaults: bool = (source)

Undocumented

_return_defaults_columns = (source)

Undocumented

_supplemental_returning = (source)

Undocumented

@util.ro_memoized_property
_all_selected_columns: _SelectIterable = (source)

A sequence of column expression objects that represents the "selected" columns of this :class:`_expression.ReturnsRows`. This is typically equivalent to .exported_columns except it is delivered in the form of a straight sequence and not keyed :class:`_expression.ColumnCollection`.