Get the indexes on the table using a new cursor.
(self, table)
| 198 | return connection.introspection.get_primary_key_column(cursor, table) |
| 199 | |
| 200 | def get_indexes(self, table): |
| 201 | """ |
| 202 | Get the indexes on the table using a new cursor. |
| 203 | """ |
| 204 | with connection.cursor() as cursor: |
| 205 | return [ |
| 206 | c["columns"][0] |
| 207 | for c in connection.introspection.get_constraints( |
| 208 | cursor, table |
| 209 | ).values() |
| 210 | if c["index"] and len(c["columns"]) == 1 |
| 211 | ] |
| 212 | |
| 213 | def get_uniques(self, table): |
| 214 | with connection.cursor() as cursor: |
no test coverage detected