diff options
Diffstat (limited to 'django/db/backends/base')
| -rw-r--r-- | django/db/backends/base/features.py | 1 | ||||
| -rw-r--r-- | django/db/backends/base/operations.py | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/django/db/backends/base/features.py b/django/db/backends/base/features.py index 35ce3ba299..31113e1c7a 100644 --- a/django/db/backends/base/features.py +++ b/django/db/backends/base/features.py @@ -38,6 +38,7 @@ class BaseDatabaseFeatures: has_select_for_update_nowait = False has_select_for_update_skip_locked = False has_select_for_update_of = False + has_select_for_no_key_update = False # Does the database's SELECT FOR UPDATE OF syntax require a column rather # than a table? select_for_update_of_column = False diff --git a/django/db/backends/base/operations.py b/django/db/backends/base/operations.py index 6d0f5c68b3..2e283a3193 100644 --- a/django/db/backends/base/operations.py +++ b/django/db/backends/base/operations.py @@ -207,11 +207,12 @@ class BaseDatabaseOperations: """ return [] - def for_update_sql(self, nowait=False, skip_locked=False, of=()): + def for_update_sql(self, nowait=False, skip_locked=False, of=(), no_key=False): """ Return the FOR UPDATE SQL clause to lock rows for an update operation. """ - return 'FOR UPDATE%s%s%s' % ( + return 'FOR%s UPDATE%s%s%s' % ( + ' NO KEY' if no_key else '', ' OF %s' % ', '.join(of) if of else '', ' NOWAIT' if nowait else '', ' SKIP LOCKED' if skip_locked else '', |
