MCPcopy
hub / github.com/django/django / get_uniques

Method get_uniques

tests/schema/tests.py:213–221  ·  view source on GitHub ↗
(self, table)

Source from the content-addressed store, hash-verified

211 ]
212
213 def get_uniques(self, table):
214 with connection.cursor() as cursor:
215 return [
216 c["columns"][0]
217 for c in connection.introspection.get_constraints(
218 cursor, table
219 ).values()
220 if c["unique"] and len(c["columns"]) == 1
221 ]
222
223 def get_constraints(self, table):
224 """

Calls 3

cursorMethod · 0.80
valuesMethod · 0.45
get_constraintsMethod · 0.45

Tested by

no test coverage detected