MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / jsonString

Method jsonString

pkg/sql/sem/tree/pretty.go:2165–2171  ·  view source on GitHub ↗

jsonString parses s as JSON and pretty prints it.

(s string)

Source from the content-addressed store, hash-verified

2163
2164// jsonString parses s as JSON and pretty prints it.
2165func (p *PrettyCfg) jsonString(s string) pretty.Doc {
2166 j, err := json.ParseJSON(s)
2167 if err != nil {
2168 return pretty.Text(s)
2169 }
2170 return p.bracket(`'`, p.jsonNode(j), `'`)
2171}
2172
2173// jsonNode pretty prints a JSON node.
2174func (p *PrettyCfg) jsonNode(j json.JSON) pretty.Doc {

Callers 1

jsonCastMethod · 0.95

Calls 4

bracketMethod · 0.95
jsonNodeMethod · 0.95
ParseJSONFunction · 0.92
TextFunction · 0.92

Tested by

no test coverage detected