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