def get_foreign_keys(self, table, schema=None):
        cursor = self.execute_sql('PRAGMA foreign_key_list("%s")' % table)
        return [ForeignKeyMetadata(row[3], row[2], row[4], table)
                for row in cursor.fetchall()]
dataset/ETHPy150Open coleifer/peewee/peewee.py/SqliteDatabase.get_foreign_keys/original