2020-11-19 06:26:57 +01:00
hljs . registerLanguage ( "sql" , ( ( ) => { "use strict" ; return e => {
2020-10-22 17:07:40 +02:00
var t = e . COMMENT ( "--" , "$" ) ; return { name : "SQL" , case _insensitive : ! 0 ,
illegal : /[<>{}*]/ , contains : [ {
beginKeywords : "begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment values with" ,
end : /;/ , endsWithParent : ! 0 , keywords : { $pattern : /[\w\.]+/ ,
keyword : " as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes _decrypt aes _encrypt after agent aggregate ali alia alias all allocate allow alter always analyze ancillary and anti any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile _base big bigfile bin binary _double binary _float binlog bit _and bit _count bit _length bit _or bit _xor bitmap blob _base block blocksize body both bound bucket buffer _cache buffer _pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char _base char _length character _length characters characterset charindex charset charsetform charsetid check checksum checksum _agg child choose chr chunk class cleanup clear client clob clob _base clone close cluster _id cluster _probability cluster _set clustering coalesce coercibility col collate collation collect colu colum column column _value columns columns _updated comment commit compact compatibility compiled complete composite _limit compound compress compute concat concat _ws concurrent confirm conn connec connect connect _by _iscycle connect _by _isleaf connect _by _root connect _time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert _tz corr corr _k corr _s corresponding corruption cos cost count count _big counted covar _pop covar _samp cpu _per _call cpu _per _session crc32 create creation critical cross cube cume _dist curdate current current _date current _time current _timestamp current _user cursor curtime customdatum cycle data database databases datafile datafiles datalength date _add date _cache date _format date _sub dateadd datediff datefromparts datename datepart datetime2fromparts day day _to _second dayname dayofmonth dayofweek dayofyear days db _role _change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete _all delimited demand dense _rank depth dequeue des _decrypt des _encrypt des _key _file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct _load directory disable disable _all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable _all enclosed encode encoding encrypt end end - exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain explode export export _set extended extent external external _1 external _2 externally extract failed failed _login _attempts failover failure far fast feature _set feature _value fetch field fields file file _name _convert filesystem _like _logging final finish first first _value fixed flash _cache flashback floor flush following follows for forall force foreign form forma format found found _rows freelist freelists freepools fresh from from _base64 from _days ftp full function general generated get get _format get _lock getdate getutcdate global global _name globally go goto grant grants greatest group group _concat group _id grouping grouping _id groups gtid _subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high _priority hosts hour hours http id ident _current ident _incr ident _seed id
literal : "true false null unknown" ,
built _in : "array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp tinyint varchar varchar2 varying void"
} , contains : [ { className : "string" , begin : "'" , end : "'" , contains : [ { begin : "''" } ] } , {
className : "string" , begin : '"' , end : '"' , contains : [ { begin : '""' } ] } , {
className : "string" , begin : "`" , end : "`"
} , e . C _NUMBER _MODE , e . C _BLOCK _COMMENT _MODE , t , e . HASH _COMMENT _MODE ]
2020-11-19 06:26:57 +01:00
} , e . C _BLOCK _COMMENT _MODE , t , e . HASH _COMMENT _MODE ] } } } ) ( ) ) ;