MCPcopy
hub / github.com/dbcli/pgcli / run

Function run

tests/utils.py:66–77  ·  view source on GitHub ↗

Return string output for the sql to be run

(executor, sql, join=False, expanded=False, pgspecial=None, exception_formatter=None)

Source from the content-addressed store, hash-verified

64
65
66def 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
80def completions_to_set(completions):

Callers 15

test_connFunction · 0.90
test_copyFunction · 0.90
test_expanded_slash_GFunction · 0.90
test_foreign_key_queryFunction · 0.90
test_functions_queryFunction · 0.90
test_datatypes_queryFunction · 0.90
test_invalid_syntaxFunction · 0.90
test_invalid_column_nameFunction · 0.90

Calls 2

format_outputFunction · 0.90
runMethod · 0.45

Tested by 15

test_connFunction · 0.72
test_copyFunction · 0.72
test_expanded_slash_GFunction · 0.72
test_foreign_key_queryFunction · 0.72
test_functions_queryFunction · 0.72
test_datatypes_queryFunction · 0.72
test_invalid_syntaxFunction · 0.72
test_invalid_column_nameFunction · 0.72