Return string output for the sql to be run
(executor, sql, join=False, expanded=False, pgspecial=None, exception_formatter=None)
| 64 | |
| 65 | |
| 66 | def run(executor, sql, join=False, expanded=False, pgspecial=None, exception_formatter=None): |
| 67 | "Return string output for the sql to be run" |
| 68 | |
| 69 | results = executor.run(sql, pgspecial, exception_formatter) |
| 70 | formatted = [] |
| 71 | settings = OutputSettings(table_format="psql", dcmlfmt="d", floatfmt="g", expanded=expanded) |
| 72 | for title, rows, headers, status, sql, success, is_special in results: |
| 73 | formatted.extend(format_output(title, rows, headers, status, settings)) |
| 74 | if join: |
| 75 | formatted = "\n".join(formatted) |
| 76 | |
| 77 | return formatted |
| 78 | |
| 79 | |
| 80 | def completions_to_set(completions): |