sql_dictionary.py 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. """
  2. ***************************************************************************
  3. sql_dictionary.py
  4. ---------------------
  5. Date : April 2012
  6. Copyright : (C) 2012 by Giuseppe Sucameli
  7. Email : brush dot tyler at gmail dot com
  8. ***************************************************************************
  9. * *
  10. * This program is free software; you can redistribute it and/or modify *
  11. * it under the terms of the GNU General Public License as published by *
  12. * the Free Software Foundation; either version 2 of the License, or *
  13. * (at your option) any later version. *
  14. * *
  15. ***************************************************************************
  16. """
  17. __author__ = 'Giuseppe Sucameli'
  18. __date__ = 'April 2012'
  19. __copyright__ = '(C) 2012, Giuseppe Sucameli'
  20. # GENERIC SQL DICTIONARY
  21. # keywords
  22. keywords = [
  23. "action", "add", "after", "all", "alter", "analyze", "and", "as", "asc",
  24. "before", "begin", "between", "by", "cascade", "case", "cast", "check",
  25. "collate", "column", "commit", "constraint", "create", "cross", "current_date",
  26. "current_time", "current_timestamp", "default", "deferrable", "deferred",
  27. "delete", "desc", "distinct", "drop", "each", "else", "end", "escape",
  28. "except", "exists", "for", "foreign", "from", "full", "group", "having",
  29. "ignore", "immediate", "in", "initially", "inner", "insert", "intersect",
  30. "into", "is", "isnull", "join", "key", "left", "like", "limit", "match",
  31. "natural", "no", "not", "notnull", "null", "of", "offset", "on", "or", "order",
  32. "outer", "primary", "references", "release", "restrict", "right", "rollback",
  33. "row", "savepoint", "select", "set", "table", "temporary", "then", "to",
  34. "transaction", "trigger", "union", "unique", "update", "using", "values",
  35. "view", "when", "where"
  36. ]
  37. # functions
  38. functions = [
  39. "abs", "changes", "coalesce", "glob", "ifnull", "hex", "last_insert_rowid",
  40. "length", "like", "lower", "ltrim", "max", "min", "nullif", "quote", "random",
  41. "randomblob", "replace", "round", "rtrim", "soundex", "total_change", "trim",
  42. "typeof", "upper", "zeroblob", "date", "datetime", "julianday", "strftime",
  43. "avg", "count", "group_concat", "sum", "total"
  44. ]
  45. # constants
  46. constants = ["null", "false", "true"]
  47. def getSqlDictionary():
  48. return {'keyword': list(keywords), 'constant': list(constants), 'function': list(functions)}