summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/schema.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-04-09 18:03:30 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-04-10 10:47:15 -0400
commitfe591913030a244a9ccfdd47b371609f1f1b44af (patch)
treef1ffb29456a2c00127b3ec3e8f2f921ba4994fa0 /lib/sqlalchemy/sql/schema.py
parentae26007d52caab1575a9aef4fecb90785f7e118d (diff)
downloadsqlalchemy-fe591913030a244a9ccfdd47b371609f1f1b44af.tar.gz
Modernize test_defaults
Use modern execution patterns, goal is so that these same tests can work for the future engine break sequence tests into test_sequences suite sequence tests that are testing implicit execution patterns at least move into their own suite that will go into test_deprecations eventually. Change-Id: I27cac9bd265c86ff2a3381ff9f844f60ef991cfc
Diffstat (limited to 'lib/sqlalchemy/sql/schema.py')
-rw-r--r--lib/sqlalchemy/sql/schema.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/schema.py b/lib/sqlalchemy/sql/schema.py
index 5c6b1f3c6..eb6c12f80 100644
--- a/lib/sqlalchemy/sql/schema.py
+++ b/lib/sqlalchemy/sql/schema.py
@@ -2100,10 +2100,17 @@ class DefaultGenerator(SchemaItem):
else:
self.column.default = self
+ @util.deprecated_20(
+ ":meth:`.DefaultGenerator.execute`",
+ alternative="All statement execution in SQLAlchemy 2.0 is performed "
+ "by the :meth:`.Connection.execute` method of :class:`.Connection`, "
+ "or in the ORM by the :meth:`.Session.execute` method of "
+ ":class:`.Session`.",
+ )
def execute(self, bind=None, **kwargs):
if bind is None:
bind = _bind_or_error(self)
- return bind._execute_default(self, **kwargs)
+ return bind.execute(self, **kwargs)
def _execute_on_connection(self, connection, multiparams, params):
return connection._execute_default(self, multiparams, params)