summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/engine
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-09-13 13:15:29 -0400
committerMike Bayer <mike_mp@zzzcomputing.com>2020-09-13 13:15:29 -0400
commit5de0688fae17f60dc3c9e1c2782c9f6c8a621291 (patch)
tree7c025e2c591264b5fae50c095a0f7e9953dbce01 /lib/sqlalchemy/engine
parenta4bfde4a18e50d93e44aec5c6216be8a6f9fbacb (diff)
downloadsqlalchemy-5de0688fae17f60dc3c9e1c2782c9f6c8a621291.tar.gz
Update session.execute() and related documentation
The docs here were completely out of date and referred to behaviors that are no longer true, behaviors that are deprecated, etc. For the moment, take out all the verbiage so that nothing incorrect is present. New ORM documentation will need to be constructed to support this statement. Change-Id: I4782aebb6443ceb68752c3b52b574fd30658ebc9
Diffstat (limited to 'lib/sqlalchemy/engine')
-rw-r--r--lib/sqlalchemy/engine/base.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/sqlalchemy/engine/base.py b/lib/sqlalchemy/engine/base.py
index afab8e7b4..3da05e743 100644
--- a/lib/sqlalchemy/engine/base.py
+++ b/lib/sqlalchemy/engine/base.py
@@ -1011,11 +1011,11 @@ class Connection(Connectable):
return self.execute(object_, *multiparams, **params).scalar()
- def execute(self, object_, *multiparams, **params):
+ def execute(self, statement, *multiparams, **params):
r"""Executes a SQL statement construct and returns a
:class:`_engine.CursorResult`.
- :param object: The statement to be executed. May be
+ :param statement: The statement to be executed. May be
one of:
* a plain string (deprecated)
@@ -1085,7 +1085,7 @@ class Connection(Connectable):
"""
- if isinstance(object_, util.string_types):
+ if isinstance(statement, util.string_types):
util.warn_deprecated_20(
"Passing a string to Connection.execute() is "
"deprecated and will be removed in version 2.0. Use the "
@@ -1095,7 +1095,7 @@ class Connection(Connectable):
)
return self._exec_driver_sql(
- object_,
+ statement,
multiparams,
params,
_EMPTY_EXECUTION_OPTS,
@@ -1103,10 +1103,10 @@ class Connection(Connectable):
)
try:
- meth = object_._execute_on_connection
+ meth = statement._execute_on_connection
except AttributeError as err:
util.raise_(
- exc.ObjectNotExecutableError(object_), replace_context=err
+ exc.ObjectNotExecutableError(statement), replace_context=err
)
else:
return meth(self, multiparams, params, _EMPTY_EXECUTION_OPTS)