def get_string_representation(sqlalchemy_expr, engine=None):
    """
    Return a string containing a SQL fragment which is compiled from the given sqlalchemy expression.

    Returns
    -------
    str
        String representation of the sqlalchemy expression.
    """
    return str(sqlalchemy_expr.compile(engine, compile_kwargs={
        'literal_binds': True}))
