

def get_indexes(self, table, schema=None):
    cursor = self.execute_sql(('SHOW INDEX FROM `%s`' % table))
    unique = set()
    indexes = {
        
    }
    for row in cursor.fetchall():
        if (not row[1]):
            unique.add(row[2])
        indexes.setdefault(row[2], [])
        indexes[row[2]].append(row[4])
    return [IndexMetadata(name, None, indexes[name], (name in unique), table) for name in indexes]

dataset/ETHPy150Open coleifer/peewee/peewee.py MySQLDatabase.get_indexes/original