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

Method Format

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

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

1296
1297// Format implements the NodeFormatter interface.
1298func (d *DString) Format(ctx *FmtCtx) {
1299 buf, f := &ctx.Buffer, ctx.flags
1300 if f.HasFlags(fmtRawStrings) || f.HasFlags(fmtPgwireFormat) {
1301 buf.WriteString(string(*d))
1302 } else {
1303 lexbase.EncodeSQLStringWithFlags(buf, string(*d), f.EncodeFlags())
1304 }
1305}
1306
1307// Size implements the Datum interface.
1308func (d *DString) Size() uintptr {

Callers

nothing calls this directly

Calls 3

EncodeSQLStringWithFlagsFunction · 0.92
EncodeFlagsMethod · 0.80
HasFlagsMethod · 0.45

Tested by

no test coverage detected