MCPcopy Create free account
hub / github.com/ajitpratap0/GoSQLX / IsReserved

Method IsReserved

pkg/sql/keywords/categories.go:167–172  ·  view source on GitHub ↗

IsReserved checks if a keyword is reserved and cannot be used as an identifier. Reserved keywords include SQL statements (SELECT, INSERT), clauses (WHERE, FROM), and other keywords that have special meaning in SQL syntax. Example: kw := keywords.New(keywords.DialectGeneric, true) kw.IsReserved("

(s string)

Source from the content-addressed store, hash-verified

165// kw.IsReserved("SELECT") // true - reserved keyword
166// kw.IsReserved("ROW_NUMBER") // false - window function (non-reserved)
167func (k *Keywords) IsReserved(s string) bool {
168 if k.ignoreCase {
169 s = strings.ToUpper(s)
170 }
171 return k.reservedKeywords[s]
172}

Calls

no outgoing calls