MCPcopy
hub / github.com/django/django / get_indexes

Method get_indexes

tests/gis_tests/geoapp/test_indexes.py:14–21  ·  view source on GitHub ↗
(self, table)

Source from the content-addressed store, hash-verified

12 models = [City]
13
14 def get_indexes(self, table):
15 with connection.cursor() as cursor:
16 constraints = connection.introspection.get_constraints(cursor, table)
17 return {
18 name: constraint["columns"]
19 for name, constraint in constraints.items()
20 if constraint["index"]
21 }
22
23 def has_spatial_indexes(self, table):
24 if connection.ops.mysql:

Callers 1

test_index_nameMethod · 0.95

Calls 3

cursorMethod · 0.80
get_constraintsMethod · 0.45
itemsMethod · 0.45

Tested by

no test coverage detected