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

Method SQLIdentifier

pkg/security/username/username.go:271–275  ·  view source on GitHub ↗

SQLIdentifier returns the normalized username in a form suitable for parsing as a SQL identifier. The identifier is quoted if it contains special characters or it is a reserved keyword.

()

Source from the content-addressed store, hash-verified

269// The identifier is quoted if it contains special characters
270// or it is a reserved keyword.
271func (s SQLUsername) SQLIdentifier() string {
272 var buf bytes.Buffer
273 lexbase.EncodeRestrictedSQLIdent(&buf, s.u, lexbase.EncNoFlags)
274 return buf.String()
275}
276
277// Format implements the fmt.Formatter interface. It renders
278// the username in normalized form.

Callers

nothing calls this directly

Calls 2

EncodeRestrictedSQLIdentFunction · 0.92
StringMethod · 0.65

Tested by

no test coverage detected