MCPcopy Create free account
hub / github.com/apache/cloudberry / ExplainJSONLineEnding

Function ExplainJSONLineEnding

src/backend/commands/explain.c:6023–6032  ·  view source on GitHub ↗

* Emit a JSON line ending. * * JSON requires a comma after each property but the last. To facilitate this, * in JSON format, the text emitted for each property begins just prior to the * preceding line-break (and comma, if applicable). */

Source from the content-addressed store, hash-verified

6021 * preceding line-break (and comma, if applicable).
6022 */
6023static void
6024ExplainJSONLineEnding(ExplainState *es)
6025{
6026 Assert(es->format == EXPLAIN_FORMAT_JSON);
6027 if (linitial_int(es->grouping_stack) != 0)
6028 appendStringInfoChar(es->str, ',');
6029 else
6030 linitial_int(es->grouping_stack) = 1;
6031 appendStringInfoChar(es->str, '\n');
6032}
6033
6034/*
6035 * Indent a YAML line.

Callers 5

ExplainPropertyListFunction · 0.85
ExplainPropertyFunction · 0.85
ExplainOpenGroupFunction · 0.85
ExplainDummyGroupFunction · 0.85

Calls 1

appendStringInfoCharFunction · 0.85

Tested by

no test coverage detected