def get_cod_ids(self, formula):
        """
        Queries the COD for all cod ids associated with a formula. Requires
        mysql executable to be in the path.

        Args:
            formula (str): Formula.

        Returns:
            List of cod ids.
        """
        # TODO: Remove dependency on external mysql call. MySQL-python package does not support Py3!

        # Standardize formula to the version used by COD.

        sql = 'select file from data where formula="- %s -"' % \
            Composition(formula).hill_formula
        text = self.query(sql).split("\n")
        cod_ids = []
        for l in text:
            m = re.search(r"(\d+)", l)
            if m:
                cod_ids.append(int(m.group(1)))
        return cod_ids