MCPcopy Create free account
hub / github.com/dolthub/doltgresql / Format

Method Format

postgres/parser/sem/tree/constant.go:479–486  ·  view source on GitHub ↗

Format implements the NodeFormatter interface.

(ctx *FmtCtx)

Source from the content-addressed store, hash-verified

477
478// Format implements the NodeFormatter interface.
479func (expr *StrVal) Format(ctx *FmtCtx) {
480 buf, f := &ctx.Buffer, ctx.flags
481 if expr.scannedAsBytes {
482 lex.EncodeSQLBytes(buf, expr.s)
483 } else {
484 lex.EncodeSQLStringWithFlags(buf, expr.s, f.EncodeFlags())
485 }
486}
487
488// WasScannedAsBytes returns true iff the input syntax was using b'...' or x'....'
489func (expr *StrVal) WasScannedAsBytes() bool {

Callers

nothing calls this directly

Calls 3

EncodeSQLBytesFunction · 0.92
EncodeSQLStringWithFlagsFunction · 0.92
EncodeFlagsMethod · 0.80

Tested by

no test coverage detected