MCPcopy Create free account
hub / github.com/auxten/postgresql-parser / EncodeRestrictedSQLIdent

Function EncodeRestrictedSQLIdent

pkg/sql/lex/encode.go:152–158  ·  view source on GitHub ↗

EncodeRestrictedSQLIdent writes the identifier in s to buf. The identifier is quoted if either the flags ask for it, the identifier contains special characters, or the identifier is a reserved SQL keyword.

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

Source from the content-addressed store, hash-verified

150// contains special characters, or the identifier is a reserved SQL
151// keyword.
152func EncodeRestrictedSQLIdent(buf *bytes.Buffer, s string, flags EncodeFlags) {
153 if flags.HasFlags(EncBareIdentifiers) || (!isReservedKeyword(s) && isBareIdentifier(s)) {
154 buf.WriteString(s)
155 return
156 }
157 EncodeEscapedSQLIdent(buf, s)
158}
159
160// EncodeEscapedSQLIdent writes the identifier in s to buf. The
161// identifier is always quoted. Double quotes inside the identifier

Callers 1

FormatMethod · 0.92

Calls 4

isReservedKeywordFunction · 0.85
isBareIdentifierFunction · 0.85
EncodeEscapedSQLIdentFunction · 0.85
HasFlagsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…