MCPcopy
hub / github.com/sqlalchemy/sqlalchemy / effective_returning

Method effective_returning

lib/sqlalchemy/sql/compiler.py:1601–1623  ·  view source on GitHub ↗

The effective "returning" columns for INSERT, UPDATE or DELETE. This is either the so-called "implicit returning" columns which are calculated by the compiler on the fly, or those present based on what's present in ``self.statement._returning`` (expanded into individual

(self)

Source from the content-addressed store, hash-verified

1599
1600 @util.ro_memoized_property
1601 def effective_returning(self) -> Optional[Sequence[ColumnElement[Any]]]:
1602 """The effective "returning" columns for INSERT, UPDATE or DELETE.
1603
1604 This is either the so-called "implicit returning" columns which are
1605 calculated by the compiler on the fly, or those present based on what's
1606 present in ``self.statement._returning`` (expanded into individual
1607 columns using the ``._all_selected_columns`` attribute) i.e. those set
1608 explicitly using the :meth:`.UpdateBase.returning` method.
1609
1610 .. versionadded:: 2.0
1611
1612 """
1613 if self.implicit_returning:
1614 return self.implicit_returning
1615 elif self.statement is not None and is_dml(self.statement):
1616 return [
1617 c
1618 for c in self.statement._all_selected_columns
1619 if is_column_element(c)
1620 ]
1621
1622 else:
1623 return None
1624
1625 @property
1626 def returning(self):

Callers

nothing calls this directly

Calls 2

is_dmlFunction · 0.85
is_column_elementFunction · 0.85

Tested by

no test coverage detected