-
Notifications
You must be signed in to change notification settings - Fork 159
/
sql.nanorc
33 lines (29 loc) · 1.73 KB
/
sql.nanorc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
syntax "sql" "\.sql$" "sqliterc$"
~KEYWORD: "\<(ALL|ASC|AS|ALTER|AND|ADD|AUTO_INCREMENT)\>"
~KEYWORD: "\<(BETWEEN|BINARY|BOTH|BY|BOOLEAN)\>"
~KEYWORD: "\<(CHANGE|CHECK|COLUMNS|COLUMN|CROSS|CREATE)\>"
~KEYWORD: "\<(DATABASES|DATABASE|DATA|DELAYED|DESCRIBE|DESC|DISTINCT|DELETE|DROP|DEFAULT)\>"
~KEYWORD: "\<(ENCLOSED|ESCAPED|EXISTS|EXPLAIN)\>"
~KEYWORD: "\<(FIELDS|FIELD|FLUSH|FOR|FOREIGN|FUNCTION|FROM)\>"
~KEYWORD: "\<(GROUP|GRANT|HAVING)\>"
~KEYWORD: "\<(IGNORE|INDEX|INFILE|INSERT|INNER|INTO|IDENTIFIED|IN|IS|IF)\>"
~KEYWORD: "\<(JOIN|KEYS|KILL|KEY)\>"
~KEYWORD: "\<(LEADING|LIKE|LIMIT|LINES|LOAD|LOCAL|LOCK|LOW_PRIORITY|LEFT|LANGUAGE)\>"
~KEYWORD: "\<(MODIFY|NATURAL|NOT|NULL|NEXTVAL)\>"
~KEYWORD: "\<(OPTIMIZE|OPTION|OPTIONALLY|ORDER|OUTFILE|OR|OUTER|ON)\>"
~KEYWORD: "\<(PROCEDURE|PROCEDURAL|PRIMARY)\>"
~KEYWORD: "\<(READ|REFERENCES|REGEXP|RENAME|REPLACE|RETURN|REVOKE|RLIKE|RIGHT)\>"
~KEYWORD: "\<(SHOW|SONAME|STATUS|STRAIGHT_JOIN|SELECT|SETVAL|SET)\>"
~KEYWORD: "\<(TABLES|TERMINATED|TO|TRAILING|TRUNCATE|TABLE|TEMPORARY|TRIGGER|TRUSTED)\>"
~KEYWORD: "\<(UNIQUE|UNLOCK|USE|USING|UPDATE|VALUES|VARIABLES|VIEW)\>"
~KEYWORD: "\<(WITH|WRITE|WHERE|ZEROFILL|TYPE|XOR)\>"
TYPE: "\<(VARCHAR|TINYINT|TEXT|DATE|SMALLINT|MEDIUMINT|INT|BIGINT|FLOAT|DOUBLE|DECIMAL|DATETIME|TIMESTAMP|TIME|YEAR|UNSIGNED|CHAR|TINYBLOB|TINYTEXT|BLOB|MEDIUMBLOB|MEDIUMTEXT|LONGBLOB|LONGTEXT|ENUM|BOOL|BINARY|VARBINARY)\>"
# SQLite meta commands
~KEYWORD: "\.\<(databases|dump|echo|exit|explain|header(s)?|help)\>"
~KEYWORD: "\.\<(import|indices|mode|nullvalue|output|prompt|quit|read)\>"
~KEYWORD: "\.\<(schema|separator|show|tables|timeout|width)\>"
BOOLEAN: "\<(ON|OFF)\>"
NUMBER: "\<([0-9]+)\>"
STRING: "\"(\\.|[^\\\"])*\"|'(\\.|[^\\'])*'|`(\\.|[^\\`])*`"
COMMENT: "\-\-.*$"
+LINT