8ef1b36f869e2548474b46039faefd476e9f16e0
[redakcja.git] / project / static / js / reg_syntax / sql.js
1 editAreaLoader.load_syntax["sql"] = {\r
2         'COMMENT_SINGLE' : {1 : '--'}\r
3         ,'COMMENT_MULTI' : {'/*' : '*/'}\r
4         ,'QUOTEMARKS' : {1: "'", 2: '"', 3: '`'}\r
5         ,'KEYWORD_CASE_SENSITIVE' : false\r
6         ,'KEYWORDS' : {\r
7                 'statements' : [\r
8                         'select', 'SELECT', 'where', 'order', 'by',\r
9                         'insert', 'from', 'update', 'grant', 'left join', 'right join', \r
10             'union', 'group', 'having', 'limit', 'alter', 'LIKE','IN','CASE'\r
11                 ]\r
12                 ,'reserved' : [\r
13                         'null', 'enum', 'int', 'boolean', 'add', 'varchar'\r
14                         \r
15                 ]\r
16                 ,'functions' : [\r
17    'ABS','ACOS','ADDDATE','ADDTIME','AES_DECRYPT','AES_ENCRYPT','ASCII','ASIN','ATAN2 ATAN','ATAN','AVG','BENCHMARK','DISTINCT','BIN','BIT_AND','BIT_COUNT','BIT_LENGTH','BIT_OR','BIT_XOR','CAST','CEILING CEIL','CHAR_LENGTH','CHAR',\r
18 'CHARACTER_LENGTH','CHARSET','COALESCE','COERCIBILITY','COLLATION','COMPRESS','CONCAT_WS','CONCAT','CONNECTION_ID','CONV','CONVERT_TZ','COS','COT','COUNT','CRC32','CURDATE','CURRENT_DATE','CURRENT_TIME','CURRENT_TIMESTAMP','CURRENT_USER','CURTIME','DATABASE','DATE_ADD','DATE_FORMAT','DATE_SUB','DATE','DATEDIFF','DAY','DAYNAME','DAYOFMONTH',\r
19 'DAYOFWEEK','DAYOFYEAR','DECODE','DEFAULT','DEGREES','DES_DECRYPT','DES_ENCRYPT','ELT','ENCODE','ENCRYPT','EXP','EXPORT_SET','EXTRACT','FIELD','FIND_IN_SET','FLOOR','FORMAT','FOUND_ROWS','FROM_DAYS','FROM_UNIXTIME','GET_FORMAT','GET_LOCK','GREATEST','GROUP_CONCAT','HEX','HOUR','IF','IFNULL','INET_ATON','INET_NTOA',\r
20 'INSERT','INSTR','INTERVAL','IS_FREE_LOCK','IS_USED_LOCK','ISNULL','LAST_DAY','LAST_INSERT_ID','LCASE','LEAST','LEFT','LENGTH','LN','LOAD_FILE','LOCALTIME','LOCALTIMESTAMP','LOCATE','LOG10','LOG2','LOG','LOWER','LPAD','LTRIM','MAKE_SET','MAKEDATE','MAKETIME','MASTER_POS_WAIT','MAX','MD5','MICROSECOND',\r
21 'MID','MIN','MINUTE','MOD','MONTH','MONTHNAME','NOW','NULLIF','OCT','OCTET_LENGTH','OLD_PASSWORD','ORD','PASSWORD','PERIOD_ADD','PERIOD_DIFF','PI','POSITION','POW','POWER','PROCEDURE ANALYSE','QUARTER','QUOTE','RADIANS','RAND','RELEASE_LOCK','REPEAT','REPLACE','REVERSE','RIGHT','ROUND',\r
22 'RPAD','RTRIM','SEC_TO_TIME','SECOND','SESSION_USER','SHA1','SHA','SIGN','SIN','SOUNDEX','SOUNDS LIKE','SPACE','SQRT','STD','STDDEV','STR_TO_DATE','STRCMP','SUBDATE','SUBSTRING_INDEX','SUBSTRING','SUBSTR','SUBTIME','SUM','SYSDATE','SYSTEM_USER','TAN','TIME_FORMAT','TIME_TO_SEC','TIME','TIMEDIFF',\r
23 'TIMESTAMP','TO_DAYS','TRIM','TRUNCATE','UCASE','UNCOMPRESS','UNCOMPRESSED_LENGTH','UNHEX','UNIX_TIMESTAMP','UPPER','USER','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','UUID','VALUES','VARIANCE','WEEK','WEEKDAY','WEEKOFYEAR','YEAR','YEARWEEK'\r
24                 ]\r
25         }\r
26         ,'OPERATORS' :[\r
27      'AND','&&','BETWEEN','BINARY','&','|','^','/','DIV','<=>','=','>=','>','<<','>>','IS','NULL','<=','<','-','%','!=','<>','!','||','OR','+','REGEXP','RLIKE','XOR','~','*'\r
28         ]\r
29         ,'DELIMITERS' :[\r
30                 '(', ')', '[', ']', '{', '}'\r
31         ]\r
32         ,'REGEXPS' : {\r
33                 // highlight all variables (@...)\r
34                 'variables' : {\r
35                         'search' : '()(\\@\\w+)()'\r
36                         ,'class' : 'variables'\r
37                         ,'modifiers' : 'g'\r
38                         ,'execute' : 'before' // before or after\r
39                 }\r
40         }\r
41         ,'STYLES' : {\r
42                 'COMMENTS': 'color: #AAAAAA;'\r
43                 ,'QUOTESMARKS': 'color: #879EFA;'\r
44                 ,'KEYWORDS' : {\r
45                         'reserved' : 'color: #48BDDF;'\r
46                         ,'functions' : 'color: #0040FD;'\r
47                         ,'statements' : 'color: #60CA00;'\r
48                         }\r
49                 ,'OPERATORS' : 'color: #FF00FF;'\r
50                 ,'DELIMITERS' : 'color: #2B60FF;'\r
51                 ,'REGEXPS' : {\r
52                         'variables' : 'color: #E0BD54;'\r
53                 }               \r
54         }\r
55 };\r