def quote_identifier_if_required(cls, identifier: str,
                                     debug_force_quote: bool = False) -> str:
        """
        Transforms a SQL identifier (such as a column name) into a version
        that is quoted if required (or, with ``debug_force_quote=True``, is
        quoted regardless).
        """
        if debug_force_quote:
            return cls.quote_identifier(identifier)
        if cls.is_quoted(identifier):
            return identifier
        if cls.requires_quoting(identifier):
            return cls.quote_identifier(identifier)
        return identifier
Transforms a SQL identifier (such as a column name) into a version
        that is quoted if required (or, with ``debug_force_quote=True``, is
        quoted regardless).