MCPcopy
hub / github.com/django/django / raw

Method raw

tests/select_for_update/tests.py:620–639  ·  view source on GitHub ↗
(status)

Source from the content-addressed store, hash-verified

618 self.start_blocking_transaction()
619
620 def raw(status):
621 try:
622 list(
623 Person.objects.raw(
624 "SELECT * FROM %s %s"
625 % (
626 Person._meta.db_table,
627 connection.ops.for_update_sql(nowait=True),
628 )
629 )
630 )
631 except DatabaseError as e:
632 status.append(e)
633 finally:
634 # This method is run in a separate thread. It uses its own
635 # database connection. Close it without waiting for the GC.
636 # Connection cannot be closed on Oracle because cursor is still
637 # open.
638 if connection.vendor != "oracle":
639 connection.close()
640
641 status = []
642 thread = threading.Thread(target=raw, kwargs={"status": status})

Calls 3

for_update_sqlMethod · 0.80
appendMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected