code: def set_foreign_key_check(self, to_check):
          
          if to_check:
              self.__db.cursor().execute('SET foreign_key_checks = 1;')
          else:
              self.__db.cursor().execute('SET foreign_key_checks = 0;')
docs: Enable/disable foreign key check. Disabling this is especially useful when
          deleting from a table with foreign key pointing to itself