def _query(self, sql: str) -> Tuple[str, int]:
        """a function to query op from cache

        Parameters
        ----------
        sql : str
            sql statement for query

        Returns
        -------
        Tuple
            profiling results
        """
        if self._mode == CacheMode.LOCAL:
            if self._db_commit_flag:
                self._con.commit()
                self._db_commit_flag = False
            self._cur.execute(sql)
            out = self._cur.fetchall()
            if len(out) == 0:
                return None
            return out[0]

        raise NotImplementedError
a function to query op from cache

        Parameters
        ----------
        sql : str
            sql statement for query

        Returns
        -------
        Tuple
            profiling results
        
python/aitemplate/backend/profiler_cache.py