MCPcopy
hub / github.com/django/django / for_update_sql

Method for_update_sql

django/db/backends/base/operations.py:238–247  ·  view source on GitHub ↗

Return the FOR UPDATE SQL clause to lock rows for an update operation.

(self, nowait=False, skip_locked=False, of=(), no_key=False)

Source from the content-addressed store, hash-verified

236 return []
237
238 def for_update_sql(self, nowait=False, skip_locked=False, of=(), no_key=False):
239 """
240 Return the FOR UPDATE SQL clause to lock rows for an update operation.
241 """
242 return "FOR%s UPDATE%s%s%s" % (
243 " NO KEY" if no_key else "",
244 " OF %s" % ", ".join(of) if of else "",
245 " NOWAIT" if nowait else "",
246 " SKIP LOCKED" if skip_locked else "",
247 )
248
249 def _get_limit_offset_params(self, low_mark, high_mark):
250 offset = low_mark or 0

Callers 5

as_sqlMethod · 0.80
has_for_update_sqlMethod · 0.80
rawMethod · 0.80

Calls 1

joinMethod · 0.45

Tested by 4

has_for_update_sqlMethod · 0.64
rawMethod · 0.64