def query(self, sql: str, *params: Any, retry: bool = False) -> List[Tuple[Any, ...]]:
        """Execute *sql* query with *params* and optionally return results.

        :param sql: the SQL statement to be run.
        :param params: positional arguments to call :func:`RestApiServer.query` with.
        :param retry: whether the query should be retried upon failure or given up immediately.

        :returns: a list of rows that were fetched from the database.
        """
        if not retry:
            return self.server.query(sql, *params)
        return Retry(delay=1, retry_exceptions=PostgresConnectionException)(self.server.query, sql, *params)
Execute *sql* query with *params* and optionally return results.

        :param sql: the SQL statement to be run.
        :param params: positional arguments to call :func:`RestApiServer.query` with.
        :param retry: whether the query should be retried upon failure or given up immediately.

        :returns: a list of rows that were fetched from the database.
        
patroni/api.py