

def get_primary_keys(self, table, schema=None):
    cursor = self.execute_sql(('SHOW INDEX FROM `%s`' % table))
    return [row[4] for row in cursor.fetchall() if (row[2] == 'PRIMARY')]

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