From 93b7767d00267ebe149cabcae7246b6796352eb8 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Sun, 2 Feb 2020 13:24:40 -0500 Subject: Deprecate connection branching The :meth:`.Connection.connect` method is deprecated as is the concept of "connection branching", which copies a :class:`.Connection` into a new one that has a no-op ".close()" method. This pattern is oriented around the "connectionless execution" concept which is also being removed in 2.0. As part of this change we begin to move the internals away from "connectionless execution" overall. Remove the "connectionless execution" concept from the reflection internals and replace with explicit patterns at the Inspector level. Fixes: #5131 Change-Id: Id23d28a9889212ac5ae7329b85136157815d3e6f --- lib/sqlalchemy/engine/interfaces.py | 38 ++++++++++--------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) (limited to 'lib/sqlalchemy/engine/interfaces.py') diff --git a/lib/sqlalchemy/engine/interfaces.py b/lib/sqlalchemy/engine/interfaces.py index cffaa159b..237eb0f2f 100644 --- a/lib/sqlalchemy/engine/interfaces.py +++ b/lib/sqlalchemy/engine/interfaces.py @@ -1092,6 +1092,16 @@ class ExecutionContext(object): raise NotImplementedError() +@util.deprecated_20_cls( + ":class:`.Connectable`", + alternative=( + "The :class:`.Engine` will be the only Core " + "object that features a .connect() method, and the " + ":class:`.Connection` will be the only object that features " + "an .execute() method." + ), + constructor=None, +) class Connectable(object): """Interface for an object which supports execution of SQL constructs. @@ -1120,34 +1130,6 @@ class Connectable(object): """ - @util.deprecated( - "0.7", - "The :meth:`.Connectable.create` method is deprecated and will be " - "removed in a future release. Please use the ``.create()`` method " - "on specific schema objects to emit DDL sequences, including " - ":meth:`.Table.create`, :meth:`.Index.create`, and " - ":meth:`.MetaData.create_all`.", - ) - def create(self, entity, **kwargs): - """Emit CREATE statements for the given schema entity. - """ - - raise NotImplementedError() - - @util.deprecated( - "0.7", - "The :meth:`.Connectable.drop` method is deprecated and will be " - "removed in a future release. Please use the ``.drop()`` method " - "on specific schema objects to emit DDL sequences, including " - ":meth:`.Table.drop`, :meth:`.Index.drop`, and " - ":meth:`.MetaData.drop_all`.", - ) - def drop(self, entity, **kwargs): - """Emit DROP statements for the given schema entity. - """ - - raise NotImplementedError() - def execute(self, object_, *multiparams, **params): """Executes the given construct and returns a :class:`.ResultProxy`.""" raise NotImplementedError() -- cgit v1.2.1