From 9ec75882203b2c01aa1d362f939e21ebcd188e8d Mon Sep 17 00:00:00 2001 From: Federico Caselli Date: Sat, 14 Mar 2020 14:02:44 +0100 Subject: Deprecate plain string in execute and introduce `exec_driver_sql` Execution of literal sql string is deprecated in the :meth:`.Connection.execute` and a warning is raised when used stating that it will be coerced to :func:`.text` in a future release. To execute a raw sql string the new connection method :meth:`.Connection.exec_driver_sql` was added, that will retain the previous behavior, passing the string to the DBAPI driver unchanged. Usage of scalar or tuple positional parameters in :meth:`.Connection.execute` is also deprecated. Fixes: #4848 Fixes: #5178 Change-Id: I2830181054327996d594f7f0d59c157d477c3aa9 --- lib/sqlalchemy/engine/reflection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sqlalchemy/engine/reflection.py') diff --git a/lib/sqlalchemy/engine/reflection.py b/lib/sqlalchemy/engine/reflection.py index ba60d634e..203369ed8 100644 --- a/lib/sqlalchemy/engine/reflection.py +++ b/lib/sqlalchemy/engine/reflection.py @@ -114,7 +114,7 @@ class Inspector(object): return self def _init_legacy(self, bind): - if hasattr(bind, "engine"): + if hasattr(bind, "exec_driver_sql"): self._init_connection(bind) else: self._init_engine(bind) -- cgit v1.2.1