MCPcopy Create free account
hub / github.com/cockroachdb/cockroachdb-parser / Format

Method Format

pkg/sql/sem/tree/datum.go:3948–3955  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

3946
3947// Format implements the NodeFormatter interface.
3948func (d *DJsonpath) Format(ctx *FmtCtx) {
3949 buf, f := &ctx.Buffer, ctx.flags
3950 if f.HasFlags(fmtRawStrings) || f.HasFlags(fmtPgwireFormat) {
3951 buf.WriteString(d.Jsonpath.String())
3952 } else {
3953 lexbase.EncodeSQLStringWithFlags(buf, d.Jsonpath.String(), f.EncodeFlags())
3954 }
3955}
3956
3957func ParseDJsonpath(s string) (Datum, error) {
3958 jp, err := ValidateJSONPath(s)

Callers

nothing calls this directly

Calls 4

EncodeSQLStringWithFlagsFunction · 0.92
EncodeFlagsMethod · 0.80
StringMethod · 0.65
HasFlagsMethod · 0.45

Tested by

no test coverage detected