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

Method Format

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

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

2388
2389// Format implements the NodeFormatter interface.
2390func (d *DTime) Format(ctx *FmtCtx) {
2391 f := ctx.flags
2392 bareStrings := f.HasFlags(FmtFlags(lexbase.EncBareStrings))
2393 if !bareStrings {
2394 ctx.WriteByte('\'')
2395 }
2396 ctx.Write(PGWireFormatTime(timeofday.TimeOfDay(*d), ctx.scratch[:0]))
2397 if !bareStrings {
2398 ctx.WriteByte('\'')
2399 }
2400}
2401
2402// Size implements the Datum interface.
2403func (d *DTime) Size() uintptr {

Callers

nothing calls this directly

Calls 5

TimeOfDayTypeAlias · 0.92
FmtFlagsTypeAlias · 0.85
PGWireFormatTimeFunction · 0.85
WriteMethod · 0.80
HasFlagsMethod · 0.45

Tested by

no test coverage detected