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

Method Format

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

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

2851
2852// Format implements the NodeFormatter interface.
2853func (d *DTimestamp) Format(ctx *FmtCtx) {
2854 f := ctx.flags
2855 bareStrings := f.HasFlags(FmtFlags(lexbase.EncBareStrings))
2856 if !bareStrings {
2857 ctx.WriteByte('\'')
2858 }
2859
2860 ctx.Write(PGWireFormatTimestamp(d.Time, nil, ctx.scratch[:0]))
2861
2862 if !bareStrings {
2863 ctx.WriteByte('\'')
2864 }
2865}
2866
2867// Size implements the Datum interface.
2868func (d *DTimestamp) Size() uintptr {

Callers

nothing calls this directly

Calls 4

FmtFlagsTypeAlias · 0.85
PGWireFormatTimestampFunction · 0.85
WriteMethod · 0.80
HasFlagsMethod · 0.45

Tested by

no test coverage detected