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

Class ExplainOutputFormatter

pgcli/explain_output_formatter.py:8–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7
8class ExplainOutputFormatter:
9 def __init__(self, max_width):
10 self.max_width = max_width
11
12 def format_output(self, cur, headers, **output_kwargs):
13 # explain query results should always contain 1 row each
14 [(data,)] = list(cur)
15 explain_list = json.loads(data)
16 visualizer = Visualizer(self.max_width)
17 for explain in explain_list:
18 visualizer.load(explain)
19 yield visualizer.get_list()

Callers 1

format_outputFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected