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

Function EncodeUnrestrictedSQLIdent

postgres/parser/lex/encode.go:153–159  ·  view source on GitHub ↗

EncodeUnrestrictedSQLIdent writes the identifier in s to buf. The identifier is only quoted if the flags don't tell otherwise and the identifier contains special characters.

(buf *bytes.Buffer, s string, flags EncodeFlags)

Source from the content-addressed store, hash-verified

151// The identifier is only quoted if the flags don't tell otherwise and
152// the identifier contains special characters.
153func EncodeUnrestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags) {
154 if flags.HasFlags(EncBareIdentifiers) || isBareIdentifier(s) {
155 buf.WriteString(s)
156 return
157 }
158 EncodeEscapedSQLIdent(buf, s)
159}
160
161// EncodeRestrictedSQLIdent writes the identifier in s to buf. The
162// identifier is quoted if either the flags ask for it, the identifier

Callers 1

FormatMethod · 0.92

Calls 4

isBareIdentifierFunction · 0.85
EncodeEscapedSQLIdentFunction · 0.85
WriteStringMethod · 0.80
HasFlagsMethod · 0.45

Tested by

no test coverage detected