diff options
Diffstat (limited to 'lib/sqlalchemy/sql/selectable.py')
-rw-r--r-- | lib/sqlalchemy/sql/selectable.py | 102 |
1 files changed, 0 insertions, 102 deletions
diff --git a/lib/sqlalchemy/sql/selectable.py b/lib/sqlalchemy/sql/selectable.py index a77cd173b..a82a76e53 100644 --- a/lib/sqlalchemy/sql/selectable.py +++ b/lib/sqlalchemy/sql/selectable.py @@ -1392,20 +1392,6 @@ class Join(roles.DMLTableRole, FromClause): self, collist, **kwargs ).select_from(self) - @property - @util.deprecated_20( - ":attr:`.Executable.bind`", - alternative="Bound metadata is being removed as of SQLAlchemy 2.0.", - enable_warnings=False, - ) - def bind(self): - """Return the bound engine associated with either the left or right - side of this :class:`_sql.Join`. - - """ - - return self.left.bind or self.right.bind - @util.preload_module("sqlalchemy.sql.util") def _anonymous_fromclause(self, name=None, flat=False): sqlutil = util.preloaded.sql_util @@ -1655,10 +1641,6 @@ class AliasedReturnsRows(NoInit, FromClause): def _from_objects(self): return [self] - @property - def bind(self): - return self.element.bind - class Alias(roles.DMLTableRole, AliasedReturnsRows): """Represents an table or selectable alias (AS). @@ -3431,13 +3413,6 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): _fetch_clause_options = None _for_update_arg = None - @util.deprecated_params( - bind=( - "2.0", - "The :paramref:`_sql.select.bind` argument is deprecated and " - "will be removed in SQLAlchemy 2.0.", - ), - ) def __init__( self, _label_style=LABEL_STYLE_DEFAULT, @@ -3446,7 +3421,6 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): offset=None, order_by=None, group_by=None, - bind=None, ): if use_labels: if util.SQLALCHEMY_WARN_20: @@ -3472,8 +3446,6 @@ class GenerativeSelect(DeprecatedSelectBaseGenerations, SelectBase): if group_by is not None: self.group_by.non_generative(self, *util.to_list(group_by)) - self._bind = bind - @_generative def with_for_update( self, @@ -4183,30 +4155,6 @@ class CompoundSelect(HasCompileState, GenerativeSelect): """ return self.selects[0].selected_columns - @property - @util.deprecated_20( - ":attr:`.Executable.bind`", - alternative="Bound metadata is being removed as of SQLAlchemy 2.0.", - enable_warnings=False, - ) - def bind(self): - """Returns the :class:`_engine.Engine` or :class:`_engine.Connection` - to which this :class:`.Executable` is bound, or None if none found. - - """ - if self._bind: - return self._bind - for s in self.selects: - e = s.bind - if e: - return e - else: - return None - - @bind.setter - def bind(self, bind): - self._bind = bind - class DeprecatedSelectGenerations: """A collection of methods available on :class:`_sql.Select`, these @@ -4973,15 +4921,6 @@ class Select( - full description of explicit FROM clause specification. - :param bind=None: - an :class:`_engine.Engine` or :class:`_engine.Connection` instance - to which the - resulting :class:`_expression.Select` object will be bound. The - :class:`_expression.Select` - object will otherwise automatically bind to - whatever :class:`~.base.Connectable` instances can be located within - its contained :class:`_expression.ClauseElement` members. - :param correlate=True: indicates that this :class:`_expression.Select` object should have its @@ -6429,43 +6368,6 @@ class Select( """ return CompoundSelect._create_intersect_all(self, *other, **kwargs) - @property - @util.deprecated_20( - ":attr:`.Executable.bind`", - alternative="Bound metadata is being removed as of SQLAlchemy 2.0.", - enable_warnings=False, - ) - def bind(self): - """Returns the :class:`_engine.Engine` or :class:`_engine.Connection` - to which this :class:`.Executable` is bound, or None if none found. - - """ - if self._bind: - return self._bind - - for item in self._iterate_from_elements(): - if item._is_subquery and item.element is self: - raise exc.InvalidRequestError( - "select() construct refers to itself as a FROM" - ) - - e = item.bind - if e: - self._bind = e - return e - else: - break - - for c in self._raw_columns: - e = c.bind - if e: - self._bind = e - return e - - @bind.setter - def bind(self, bind): - self._bind = bind - class ScalarSelect(roles.InElementRole, Generative, Grouping): """Represent a scalar subquery. @@ -6843,10 +6745,6 @@ class TextualSelect(SelectBase): def _ensure_disambiguated_names(self): return self - @property - def _bind(self): - return self.element._bind - @_generative def bindparams(self, *binds, **bind_as_values): self.element = self.element.bindparams(*binds, **bind_as_values) |