reserved.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. package sqlite
  2. import "strings"
  3. // https://sqlite.org/lang_keywords.html
  4. func (p *Parser) IsReservedKeyword(s string) bool {
  5. switch strings.ToLower(s) {
  6. case "abort":
  7. case "action":
  8. case "add":
  9. case "after":
  10. case "all":
  11. case "alter":
  12. case "always":
  13. case "analyze":
  14. case "and":
  15. case "as":
  16. case "asc":
  17. case "attach":
  18. case "autoincrement":
  19. case "before":
  20. case "begin":
  21. case "between":
  22. case "by":
  23. case "cascade":
  24. case "case":
  25. case "cast":
  26. case "check":
  27. case "collate":
  28. case "column":
  29. case "commit":
  30. case "conflict":
  31. case "constraint":
  32. case "create":
  33. case "cross":
  34. case "current":
  35. case "current_date":
  36. case "current_time":
  37. case "current_timestamp":
  38. case "database":
  39. case "default":
  40. case "deferrable":
  41. case "deferred":
  42. case "delete":
  43. case "desc":
  44. case "detach":
  45. case "distinct":
  46. case "do":
  47. case "drop":
  48. case "each":
  49. case "else":
  50. case "end":
  51. case "escape":
  52. case "except":
  53. case "exclude":
  54. case "exclusive":
  55. case "exists":
  56. case "explain":
  57. case "fail":
  58. case "filter":
  59. case "first":
  60. case "following":
  61. case "for":
  62. case "foreign":
  63. case "from":
  64. case "full":
  65. case "generated":
  66. case "glob":
  67. case "group":
  68. case "groups":
  69. case "having":
  70. case "if":
  71. case "ignore":
  72. case "immediate":
  73. case "in":
  74. case "index":
  75. case "indexed":
  76. case "initially":
  77. case "inner":
  78. case "insert":
  79. case "instead":
  80. case "intersect":
  81. case "into":
  82. case "is":
  83. case "isnull":
  84. case "join":
  85. case "key":
  86. case "last":
  87. case "left":
  88. case "like":
  89. case "limit":
  90. case "match":
  91. case "natural":
  92. case "no":
  93. case "not":
  94. case "nothing":
  95. case "notnull":
  96. case "null":
  97. case "nulls":
  98. case "of":
  99. case "offset":
  100. case "on":
  101. case "or":
  102. case "order":
  103. case "others":
  104. case "outer":
  105. case "over":
  106. case "partition":
  107. case "plan":
  108. case "pragma":
  109. case "preceding":
  110. case "primary":
  111. case "query":
  112. case "raise":
  113. case "range":
  114. case "recursive":
  115. case "references":
  116. case "regexp":
  117. case "reindex":
  118. case "release":
  119. case "rename":
  120. case "replace":
  121. case "restrict":
  122. case "right":
  123. case "rollback":
  124. case "row":
  125. case "rows":
  126. case "savepoint":
  127. case "select":
  128. case "set":
  129. case "table":
  130. case "temp":
  131. case "temporary":
  132. case "then":
  133. case "ties":
  134. case "to":
  135. case "transaction":
  136. case "trigger":
  137. case "unbounded":
  138. case "union":
  139. case "unique":
  140. case "update":
  141. case "using":
  142. case "vacuum":
  143. case "values":
  144. case "view":
  145. case "virtual":
  146. case "when":
  147. case "where":
  148. case "window":
  149. case "with":
  150. case "without":
  151. default:
  152. return false
  153. }
  154. return true
  155. }