summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/query.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-02-02 11:39:37 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-03-23 14:06:13 -0400
commit0a4f7f38ce2b878a4e59da74373938b64bbb6e92 (patch)
tree736194f482f6efde4638e72e5e83c09c7a04493e /lib/sqlalchemy/orm/query.py
parentfd74bd8eea3f3696c43ca0336ed4e437036c43c5 (diff)
downloadsqlalchemy-0a4f7f38ce2b878a4e59da74373938b64bbb6e92.tar.gz
Remove deprecated elements from selectable.py; remove lockmode
Removed autocommit and legacy "for update" / "lockmode" elements from selectable.py / query.py. lockmode was removed from selectable in 693938dd6fb2f3ee3e031aed4c62355ac97f3ceb however was not removed from the ORM. Also removes the ignore_nonexistent_tables option on join(). Change-Id: I0cfcf9e6a8d4ef6432c9e25ef75173b3b3f5fd87 Partially-fixes: #4643
Diffstat (limited to 'lib/sqlalchemy/orm/query.py')
-rw-r--r--lib/sqlalchemy/orm/query.py60
1 files changed, 1 insertions, 59 deletions
diff --git a/lib/sqlalchemy/orm/query.py b/lib/sqlalchemy/orm/query.py
index 0da7d08a4..617bba315 100644
--- a/lib/sqlalchemy/orm/query.py
+++ b/lib/sqlalchemy/orm/query.py
@@ -1622,39 +1622,6 @@ class Query(Generative):
self._execution_options = self._execution_options.union(kwargs)
@_generative
- @util.deprecated(
- "0.9",
- "The :meth:`.Query.with_lockmode` method is deprecated and will "
- "be removed in a future release. Please refer to "
- ":meth:`.Query.with_for_update`. ",
- )
- def with_lockmode(self, mode):
- """Return a new :class:`.Query` object with the specified "locking mode",
- which essentially refers to the ``FOR UPDATE`` clause.
-
- :param mode: a string representing the desired locking mode.
- Valid values are:
-
- * ``None`` - translates to no lockmode
-
- * ``'update'`` - translates to ``FOR UPDATE``
- (standard SQL, supported by most dialects)
-
- * ``'update_nowait'`` - translates to ``FOR UPDATE NOWAIT``
- (supported by Oracle, PostgreSQL 8.1 upwards)
-
- * ``'read'`` - translates to ``LOCK IN SHARE MODE`` (for MySQL),
- and ``FOR SHARE`` (for PostgreSQL)
-
- .. seealso::
-
- :meth:`.Query.with_for_update` - improved API for
- specifying the ``FOR UPDATE`` clause.
-
- """
- self._for_update_arg = LockmodeArg.parse_legacy_query(mode)
-
- @_generative
def with_for_update(
self,
read=False,
@@ -1681,16 +1648,13 @@ class Query(Generative):
SELECT users.id AS users_id FROM users FOR UPDATE OF users NOWAIT
- .. versionadded:: 0.9.0 :meth:`.Query.with_for_update` supersedes
- the :meth:`.Query.with_lockmode` method.
-
.. seealso::
:meth:`.GenerativeSelect.with_for_update` - Core level method with
full argument and behavioral description.
"""
- self._for_update_arg = LockmodeArg(
+ self._for_update_arg = ForUpdateArg(
read=read,
nowait=nowait,
of=of,
@@ -4098,28 +4062,6 @@ class Query(Generative):
)
-class LockmodeArg(ForUpdateArg):
- @classmethod
- def parse_legacy_query(cls, mode):
- if mode in (None, False):
- return None
-
- if mode == "read":
- read = True
- nowait = False
- elif mode == "update":
- read = nowait = False
- elif mode == "update_nowait":
- nowait = True
- read = False
- else:
- raise sa_exc.ArgumentError(
- "Unknown with_lockmode argument: %r" % mode
- )
-
- return LockmodeArg(read=read, nowait=nowait)
-
-
class _QueryEntity(object):
"""represent an entity column returned within a Query result."""