예제 #1
0
def run(executor, sql, join=False):
    " Return string output for the sql to be run "
    result = []
    for title, rows, headers, status in executor.run(sql):
        result.extend(format_output(title, rows, headers, status, 'psql', special.is_expanded_output()))
    if join:
        result = '\n'.join(result)
    return result
예제 #2
0
def run(executor, sql, join=False):
    """Return string output for the sql to be run."""
    result = []

    # TODO: this needs to go away. `run()` should not test formatted output.
    # It should test raw results.
    mycli = MyCli()
    for title, rows, headers, status in executor.run(sql):
        result.extend(
            mycli.format_output(title, rows, headers, status,
                                special.is_expanded_output()))

    if join:
        result = '\n'.join(result)
    return result
def is_expanded_output():
    """Pass-through for the tests."""
    return special.is_expanded_output()
예제 #4
0
파일: utils.py 프로젝트: DaveXanderXU/mycli
def is_expanded_output():
    """Pass-through for the tests."""
    return special.is_expanded_output()