MCPcopy Create free account
hub / github.com/bytebase/bytebase / isValidUnquotedIdentifier

Function isValidUnquotedIdentifier

backend/plugin/parser/redshift/completion.go:270–285  ·  view source on GitHub ↗

isValidUnquotedIdentifier checks if the identifier can be used without quotes in Redshift.

(s string)

Source from the content-addressed store, hash-verified

268
269// isValidUnquotedIdentifier checks if the identifier can be used without quotes in Redshift.
270func isValidUnquotedIdentifier(s string) bool {
271 if len(s) == 0 {
272 return false
273 }
274
275 first := rune(s[0])
276 if !unicode.IsLetter(first) && first != '_' {
277 return false
278 }
279 for _, ch := range s[1:] {
280 if !unicode.IsLetter(ch) && !unicode.IsDigit(ch) && ch != '_' {
281 return false
282 }
283 }
284 return true
285}
286
287func convertCandidateType(t redshiftcompletion.CandidateType) base.CandidateType {
288 switch t {

Callers 1

quotedIdentifierIfNeededFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected