* 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). */
| 6021 | * preceding line-break (and comma, if applicable). |
| 6022 | */ |
| 6023 | static void |
| 6024 | ExplainJSONLineEnding(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. |
no test coverage detected