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

Function FormatDuration

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

FormatDuration writes d into ctx according to the format flags.

(d duration.Duration, ctx *FmtCtx)

Source from the content-addressed store, hash-verified

3268
3269// FormatDuration writes d into ctx according to the format flags.
3270func FormatDuration(d duration.Duration, ctx *FmtCtx) {
3271 f := ctx.flags
3272 bareStrings := f.HasFlags(FmtFlags(lexbase.EncBareStrings))
3273 if !bareStrings {
3274 ctx.WriteByte('\'')
3275 }
3276 d.FormatWithStyle(&ctx.Buffer, ctx.dataConversionConfig.IntervalStyle)
3277 if !bareStrings {
3278 ctx.WriteByte('\'')
3279 }
3280}
3281
3282// Format implements the NodeFormatter interface.
3283func (d *DInterval) Format(ctx *FmtCtx) {

Callers 1

FormatMethod · 0.85

Calls 3

FmtFlagsTypeAlias · 0.85
FormatWithStyleMethod · 0.80
HasFlagsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…