evalbench/databases/mysql.py [84:123]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            )

    #####################################################
    #####################################################
    # Database Specific Execution Logic and Handling
    #####################################################
    #####################################################

    def _execute_queries(self, connection: Connection, query: str) -> List:
        result: List = []
        for sub_query in sqlparse.split(query):
            if sub_query:
                resultset = connection.execute(text(sub_query))
                if resultset.returns_rows:
                    rows = resultset.fetchall()
                    result.extend(r._asdict() for r in rows)
        return result

    def batch_execute(self, commands: list[str]):
        batch_commands = []
        for command in commands:
            if command.strip() != "":
                batch_commands.append(command)
        _, _, error = self._execute("SELECT 1;", batch_commands=batch_commands)
        if error:
            raise RuntimeError(f"{error}")

    def execute(
        self,
        query: str,
        eval_query: Optional[str] = None,
        use_cache=False,
        rollback=False,
    ) -> Tuple[Any, Any, Any]:
        if query.strip() == "":
            return None, None, None
        if not use_cache or not self.cache_client or eval_query:
            return self._execute(query, eval_query, rollback)
        return with_cache_execute(
            query,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



evalbench/databases/sqlite.py [54:93]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            )

    #####################################################
    #####################################################
    # Database Specific Execution Logic and Handling
    #####################################################
    #####################################################

    def _execute_queries(self, connection: Connection, query: str) -> List:
        result: List = []
        for sub_query in sqlparse.split(query):
            if sub_query:
                resultset = connection.execute(text(sub_query))
                if resultset.returns_rows:
                    rows = resultset.fetchall()
                    result.extend(r._asdict() for r in rows)
        return result

    def batch_execute(self, commands: list[str]):
        batch_commands = []
        for command in commands:
            if command.strip() != "":
                batch_commands.append(command)
        _, _, error = self._execute("SELECT 1;", batch_commands=batch_commands)
        if error:
            raise RuntimeError(f"{error}")

    def execute(
        self,
        query: str,
        eval_query: Optional[str] = None,
        use_cache=False,
        rollback=False,
    ) -> Tuple[Any, Any, Any]:
        if query.strip() == "":
            return None, None, None
        if not use_cache or not self.cache_client or eval_query:
            return self._execute(query, eval_query, rollback)
        return with_cache_execute(
            query,
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



