| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735 |
- [[
- "start"
- ],[
- "start",
- ["keyword.statementBegin","BEGIN"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "doc-start",
- ["comment.doc","/**"]
- ],[
- "doc-start",
- ["comment.doc","* Samples from PostgreSQL src/tutorial/basics.source"]
- ],[
- "start",
- ["comment.doc","*/"]
- ],[
- "statement",
- ["keyword.statementBegin","CREATE"],
- ["text"," "],
- ["keyword","TABLE"],
- ["text"," "],
- ["identifier","weather"],
- ["text"," "],
- ["paren.lparen","("]
- ],[
- "statement",
- ["text","\t"],
- ["identifier","city"],
- ["text","\t\t"],
- ["keyword","varchar"],
- ["paren.lparen","("],
- ["constant.numeric","80"],
- ["paren.rparen",")"],
- ["text",","]
- ],[
- "statement",
- ["text","\t"],
- ["identifier","temp_lo"],
- ["text","\t\t"],
- ["keyword","int"],
- ["text",",\t\t"],
- ["comment","-- low temperature"]
- ],[
- "statement",
- ["text","\t"],
- ["identifier","temp_hi"],
- ["text","\t\t"],
- ["keyword","int"],
- ["text",",\t\t"],
- ["comment","-- high temperature"]
- ],[
- "statement",
- ["text","\t"],
- ["identifier","prcp"],
- ["text","\t\t"],
- ["keyword","real"],
- ["text",",\t\t"],
- ["comment","-- precipitation"]
- ],[
- "statement",
- ["text","\t"],
- ["variable.language","\"date\""],
- ["text","\t\t"],
- ["keyword","date"]
- ],[
- "start",
- ["paren.rparen",")"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "statement",
- ["keyword.statementBegin","CREATE"],
- ["text"," "],
- ["keyword","TABLE"],
- ["text"," "],
- ["identifier","cities"],
- ["text"," "],
- ["paren.lparen","("]
- ],[
- "statement",
- ["text","\t"],
- ["keyword","name"],
- ["text","\t\t"],
- ["keyword","varchar"],
- ["paren.lparen","("],
- ["constant.numeric","80"],
- ["paren.rparen",")"],
- ["text",","]
- ],[
- "statement",
- ["text","\t"],
- ["keyword","location"],
- ["text","\t"],
- ["keyword","point"]
- ],[
- "start",
- ["paren.rparen",")"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "start"
- ],[
- "statement",
- ["keyword.statementBegin","INSERT"],
- ["text"," "],
- ["keyword","INTO"],
- ["text"," "],
- ["identifier","weather"]
- ],[
- "start",
- ["text"," "],
- ["keyword","VALUES"],
- ["text"," "],
- ["paren.lparen","("],
- ["string","'San Francisco'"],
- ["text",", "],
- ["constant.numeric","46"],
- ["text",", "],
- ["constant.numeric","50"],
- ["text",", "],
- ["constant.numeric","0.25"],
- ["text",", "],
- ["string","'1994-11-27'"],
- ["paren.rparen",")"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "statement",
- ["keyword.statementBegin","INSERT"],
- ["text"," "],
- ["keyword","INTO"],
- ["text"," "],
- ["identifier","cities"]
- ],[
- "start",
- ["text"," "],
- ["keyword","VALUES"],
- ["text"," "],
- ["paren.lparen","("],
- ["string","'San Francisco'"],
- ["text",", "],
- ["string","'(-194.0, 53.0)'"],
- ["paren.rparen",")"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "statement",
- ["keyword.statementBegin","INSERT"],
- ["text"," "],
- ["keyword","INTO"],
- ["text"," "],
- ["identifier","weather"],
- ["text"," "],
- ["paren.lparen","("],
- ["identifier","city"],
- ["text",", "],
- ["identifier","temp_lo"],
- ["text",", "],
- ["identifier","temp_hi"],
- ["text",", "],
- ["identifier","prcp"],
- ["text",", "],
- ["variable.language","\"date\""],
- ["paren.rparen",")"]
- ],[
- "start",
- ["text"," "],
- ["keyword","VALUES"],
- ["text"," "],
- ["paren.lparen","("],
- ["string","'San Francisco'"],
- ["text",", "],
- ["constant.numeric","43"],
- ["text",", "],
- ["constant.numeric","57"],
- ["text",", "],
- ["constant.numeric","0.0"],
- ["text",", "],
- ["string","'1994-11-29'"],
- ["paren.rparen",")"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "statement",
- ["keyword.statementBegin","INSERT"],
- ["text"," "],
- ["keyword","INTO"],
- ["text"," "],
- ["identifier","weather"],
- ["text"," "],
- ["paren.lparen","("],
- ["keyword","date"],
- ["text",", "],
- ["identifier","city"],
- ["text",", "],
- ["identifier","temp_hi"],
- ["text",", "],
- ["identifier","temp_lo"],
- ["paren.rparen",")"]
- ],[
- "start",
- ["text"," "],
- ["keyword","VALUES"],
- ["text"," "],
- ["paren.lparen","("],
- ["string","'1994-11-29'"],
- ["text",", "],
- ["string","'Hayward'"],
- ["text",", "],
- ["constant.numeric","54"],
- ["text",", "],
- ["constant.numeric","37"],
- ["paren.rparen",")"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "start"
- ],[
- "start",
- ["keyword.statementBegin","SELECT"],
- ["text"," "],
- ["identifier","city"],
- ["text",", "],
- ["paren.lparen","("],
- ["identifier","temp_hi"],
- ["keyword.operator","+"],
- ["identifier","temp_lo"],
- ["paren.rparen",")"],
- ["keyword.operator","/"],
- ["constant.numeric","2"],
- ["text"," "],
- ["keyword","AS"],
- ["text"," "],
- ["identifier","temp_avg"],
- ["text",", "],
- ["variable.language","\"date\""],
- ["text"," "],
- ["keyword","FROM"],
- ["text"," "],
- ["identifier","weather"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "statement",
- ["keyword.statementBegin","SELECT"],
- ["text"," "],
- ["identifier","city"],
- ["text",", "],
- ["identifier","temp_lo"],
- ["text",", "],
- ["identifier","temp_hi"],
- ["text",", "],
- ["identifier","prcp"],
- ["text",", "],
- ["variable.language","\"date\""],
- ["text",", "],
- ["keyword","location"]
- ],[
- "statement",
- ["text"," "],
- ["keyword","FROM"],
- ["text"," "],
- ["identifier","weather"],
- ["text",", "],
- ["identifier","cities"]
- ],[
- "start",
- ["text"," "],
- ["keyword","WHERE"],
- ["text"," "],
- ["identifier","city"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["keyword","name"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "start"
- ],[
- "start"
- ],[
- "doc-start",
- ["comment.doc","/**"]
- ],[
- "doc-start",
- ["comment.doc","* Dollar quotes starting at the end of the line are colored as SQL unless"]
- ],[
- "doc-start",
- ["comment.doc","* a special language tag is used. Pearl and Python are currently implemented"]
- ],[
- "doc-start",
- ["comment.doc","* but lots of others are possible."]
- ],[
- "start",
- ["comment.doc","*/"]
- ],[
- "statement",
- ["keyword.statementBegin","create"],
- ["text"," "],
- ["keyword","or"],
- ["text"," "],
- ["keyword","replace"],
- ["text"," "],
- ["keyword","function"],
- ["text"," "],
- ["identifier","blob_content_chunked"],
- ["paren.lparen","("]
- ],[
- "statement",
- ["text"," "],
- ["keyword","in"],
- ["text"," "],
- ["identifier","p_data"],
- ["text"," "],
- ["keyword","bytea"],
- ["text",", "]
- ],[
- "statement",
- ["text"," "],
- ["keyword","in"],
- ["text"," "],
- ["identifier","p_chunk"],
- ["text"," "],
- ["keyword","integer"],
- ["paren.rparen",")"]
- ],[
- "dollarSql",
- ["keyword","returns"],
- ["text"," "],
- ["keyword","setof"],
- ["text"," "],
- ["keyword","bytea"],
- ["text"," "],
- ["keyword","as"],
- ["text"," "],
- ["string","$$"]
- ],[
- "dollarSql",
- ["comment","-- Still SQL comments"]
- ],[
- "dollarSql",
- ["keyword","declare"]
- ],[
- "dollarSql",
- ["text","\t"],
- ["identifier","v_size"],
- ["text"," "],
- ["keyword","integer"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["support.function","octet_length"],
- ["paren.lparen","("],
- ["identifier","p_data"],
- ["paren.rparen",")"],
- ["text",";"]
- ],[
- "dollarSql",
- ["keyword","begin"]
- ],[
- "dollarSql",
- ["text","\t"],
- ["keyword","for"],
- ["text"," "],
- ["identifier","i"],
- ["text"," "],
- ["keyword","in"],
- ["text"," "],
- ["constant.numeric","1"],
- ["text",".."],
- ["identifier","v_size"],
- ["text"," "],
- ["keyword","by"],
- ["text"," "],
- ["identifier","p_chunk"],
- ["text"," "],
- ["identifier","loop"]
- ],[
- "dollarSql",
- ["text","\t\t"],
- ["identifier","return"],
- ["text"," "],
- ["keyword","next"],
- ["text"," "],
- ["keyword","substring"],
- ["paren.lparen","("],
- ["identifier","p_data"],
- ["text"," "],
- ["keyword","from"],
- ["text"," "],
- ["identifier","i"],
- ["text"," "],
- ["keyword","for"],
- ["text"," "],
- ["identifier","p_chunk"],
- ["paren.rparen",")"],
- ["text",";"]
- ],[
- "dollarSql",
- ["text","\t"],
- ["keyword","end"],
- ["text"," "],
- ["identifier","loop"],
- ["text",";"]
- ],[
- "dollarSql",
- ["keyword","end"],
- ["text",";"]
- ],[
- "start",
- ["string","$$"],
- ["text"," "],
- ["keyword","language"],
- ["text"," "],
- ["identifier","plpgsql"],
- ["text"," "],
- ["keyword","stable"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "start"
- ],[
- "start",
- ["comment","-- pl/perl"]
- ],[
- "perl-start",
- ["keyword.statementBegin","CREATE"],
- ["text"," "],
- ["keyword","FUNCTION"],
- ["text"," "],
- ["identifier","perl_max"],
- ["text"," "],
- ["paren.lparen","("],
- ["keyword","integer"],
- ["text",", "],
- ["keyword","integer"],
- ["paren.rparen",")"],
- ["text"," "],
- ["keyword","RETURNS"],
- ["text"," "],
- ["keyword","integer"],
- ["text"," "],
- ["keyword","AS"],
- ["text"," "],
- ["string","$perl$"]
- ],[
- "perl-start",
- ["text"," "],
- ["comment","# perl comment..."]
- ],[
- "perl-start",
- ["text"," "],
- ["keyword","my"],
- ["text"," "],
- ["lparen","("],
- ["identifier","$x"],
- ["keyword.operator",","],
- ["identifier","$y"],
- ["rparen",")"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," @"],
- ["identifier","_"],
- ["text",";"]
- ],[
- "perl-start",
- ["text"," "],
- ["keyword","if"],
- ["text"," "],
- ["lparen","("],
- ["keyword.operator","!"],
- ["text"," "],
- ["support.function","defined"],
- ["text"," "],
- ["identifier","$x"],
- ["rparen",")"],
- ["text"," "],
- ["lparen","{"]
- ],[
- "perl-start",
- ["text"," "],
- ["keyword","if"],
- ["text"," "],
- ["lparen","("],
- ["keyword.operator","!"],
- ["text"," "],
- ["support.function","defined"],
- ["text"," "],
- ["identifier","$y"],
- ["rparen",")"],
- ["text"," "],
- ["lparen","{"],
- ["text"," "],
- ["support.function","return"],
- ["text"," "],
- ["support.function","undef"],
- ["text","; "],
- ["rparen","}"]
- ],[
- "perl-start",
- ["text"," "],
- ["support.function","return"],
- ["text"," "],
- ["identifier","$y"],
- ["text",";"]
- ],[
- "perl-start",
- ["text"," "],
- ["rparen","}"]
- ],[
- "perl-start",
- ["text"," "],
- ["keyword","if"],
- ["text"," "],
- ["lparen","("],
- ["keyword.operator","!"],
- ["text"," "],
- ["support.function","defined"],
- ["text"," "],
- ["identifier","$y"],
- ["rparen",")"],
- ["text"," "],
- ["lparen","{"],
- ["text"," "],
- ["support.function","return"],
- ["text"," "],
- ["identifier","$x"],
- ["text","; "],
- ["rparen","}"]
- ],[
- "perl-start",
- ["text"," "],
- ["keyword","if"],
- ["text"," "],
- ["lparen","("],
- ["identifier","$x"],
- ["text"," "],
- ["keyword.operator",">"],
- ["text"," "],
- ["identifier","$y"],
- ["rparen",")"],
- ["text"," "],
- ["lparen","{"],
- ["text"," "],
- ["support.function","return"],
- ["text"," "],
- ["identifier","$x"],
- ["text","; "],
- ["rparen","}"]
- ],[
- "perl-start",
- ["text"," "],
- ["support.function","return"],
- ["text"," "],
- ["identifier","$y"],
- ["text",";"]
- ],[
- "start",
- ["string","$perl$"],
- ["text"," "],
- ["keyword","LANGUAGE"],
- ["text"," "],
- ["identifier","plperl"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "start",
- ["comment","-- pl/python"]
- ],[
- "python-start",
- ["keyword.statementBegin","CREATE"],
- ["text"," "],
- ["keyword","FUNCTION"],
- ["text"," "],
- ["identifier","usesavedplan"],
- ["paren.lparen","("],
- ["paren.rparen",")"],
- ["text"," "],
- ["keyword","RETURNS"],
- ["text"," "],
- ["keyword","trigger"],
- ["text"," "],
- ["keyword","AS"],
- ["text"," "],
- ["string","$python$"]
- ],[
- "python-start",
- ["text"," "],
- ["comment","# python comment..."]
- ],[
- "python-start",
- ["text"," "],
- ["keyword","if"],
- ["text"," "],
- ["identifier","SD"],
- ["text","."],
- ["identifier","has_key"],
- ["paren.lparen","("],
- ["string","\"plan\""],
- ["paren.rparen",")"],
- ["text",":"]
- ],[
- "python-start",
- ["text"," "],
- ["identifier","plan"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["identifier","SD"],
- ["paren.lparen","["],
- ["string","\"plan\""],
- ["paren.rparen","]"]
- ],[
- "python-start",
- ["text"," "],
- ["keyword","else"],
- ["text",":"]
- ],[
- "python-start",
- ["text"," "],
- ["identifier","plan"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["identifier","plpy"],
- ["text","."],
- ["identifier","prepare"],
- ["paren.lparen","("],
- ["string","\"SELECT 1\""],
- ["paren.rparen",")"]
- ],[
- "python-start",
- ["text"," "],
- ["identifier","SD"],
- ["paren.lparen","["],
- ["string","\"plan\""],
- ["paren.rparen","]"],
- ["text"," "],
- ["keyword.operator","="],
- ["text"," "],
- ["identifier","plan"]
- ],[
- "start",
- ["string","$python$"],
- ["text"," "],
- ["keyword","LANGUAGE"],
- ["text"," "],
- ["identifier","plpythonu"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "start"
- ],[
- "start",
- ["comment","-- psql commands"]
- ],[
- "start",
- ["support.buildin","\\df cash*"]
- ],[
- "start"
- ],[
- "start"
- ],[
- "start",
- ["comment","-- Some string samples."]
- ],[
- "start",
- ["keyword.statementBegin","select"],
- ["text"," "],
- ["string","'don''t do it now;'"],
- ["text"," "],
- ["keyword.operator","||"],
- ["text"," "],
- ["string","'maybe later'"],
- ["statementEnd",";"]
- ],[
- "start",
- ["keyword.statementBegin","select"],
- ["text"," "],
- ["identifier","E"],
- ["string","'dont\\'t do it'"],
- ["statementEnd",";"]
- ],[
- "start",
- ["keyword.statementBegin","select"],
- ["text"," "],
- ["support.function","length"],
- ["paren.lparen","("],
- ["string","'some other''s stuff'"],
- ["text"," "],
- ["keyword.operator","||"],
- ["text"," "],
- ["string","$$cat in hat's stuff $$"],
- ["paren.rparen",")"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "dollarStatementString",
- ["keyword.statementBegin","select"],
- ["text"," "],
- ["string","$$ strings"]
- ],[
- "dollarStatementString",
- ["string","over multiple "]
- ],[
- "dollarStatementString",
- ["string","lines - use dollar quotes"]
- ],[
- "start",
- ["string","$$"],
- ["statementEnd",";"]
- ],[
- "start"
- ],[
- "start",
- ["keyword.statementBegin","END"],
- ["statementEnd",";"]
- ],[
- "start"
- ]]
|