# Define SciTE settings for SQL, PL/SQL, Apache Hive and Apache Pig files.

file.patterns.sql=*.sql
file.patterns.plsql=*.spec;*.body;*.sps;*.spb;*.sf;*.sp
file.patterns.hql=*.hql
file.patterns.pig=*.pig

lexer.$(file.patterns.sql)=sql
lexer.$(file.patterns.plsql)=sql
lexer.$(file.patterns.hql)=sql
lexer.$(file.patterns.pig)=sql

file.patterns.sql.like=$(file.patterns.sql);$(file.patterns.plsql);$(file.patterns.hql);$(file.patterns.pig)

*source.patterns.sql=$(file.patterns.sql.like);

filter.sql=SQL (sql)|$(file.patterns.sql.like)|

*filter.sql=$(filter.sql)

*language.sql=S&QL|sql||

#*language.plsql=P&LSQL|spec||
#*language.hql=Hive SQL|hql||
#*language.pig=Pig Query|pig||

# SQL comments
comment.block.sql=--
#comment.block.at.line.start.sql=1
comment.stream.start.sql=/*
comment.stream.end.sql=*/
comment.box.start.sql=/*
comment.box.middle.sql= *
comment.box.end.sql= */

# SQL styles
# White space
style.sql.0=fore:#808080
# Comment
style.sql.1=fore:#007F00,$(font.comment)
# Line Comment
style.sql.2=fore:#007F00,$(font.comment)
# Doc comment
style.sql.3=fore:#7F7F7F
# Number
style.sql.4=fore:#007F7F
# Keyword
style.sql.5=fore:#00007F,bold
# Double quoted string
style.sql.6=fore:#7F007F,$(font.monospace)
# Single quoted string
style.sql.7=fore:#7F007F,$(font.monospace)
# SQL*Plus
style.sql.8=$(colour.preproc)
# SQL*Plus PROMPT
style.sql.9=fore:#007F00,$(font.monospace),back:#E0FFE0,eolfilled
# Operators
style.sql.10=bold
# Identifiers
style.sql.11=
# Not used
#style.sql.12=fore:#000000,$(font.monospace),back:#E0C0E0,eolfilled
# SQL*Plus Comment
style.sql.13=fore:#007F00,$(font.comment)
# not used
# style.sql.14=
# Hash Line Comment
style.sql.15=fore:#007F00,$(font.comment)
# Keywords2: Database objects
style.sql.16=fore:#B00040
# Comment Doc Keyword
style.sql.17=fore:#3060A0,$(font.code.comment.doc)
# Comment Doc Keyword Error
style.sql.18=fore:#804020,$(font.code.comment.doc)
# Keywords5: User Keywords 1
style.sql.19=fore:#4B0082
# Keywords6: User Keywords 2
style.sql.20=fore:#B00040
# Keywords7: User Keywords 3
style.sql.21=fore:#8B0000
# Keywords8: User Keywords 4
style.sql.22=fore:#800080
# Quoted identifier
style.sql.23=fore:#DD9900
# Q operator
style.sql.24=fore:#EE00AA

# Braces are only matched in operator style
braces.sql.style=10
# Enables backslash as an escape character
#sql.backslash.escapes=1

# Activate '#' based comments for MySQL with 1 or disable for Oracle with 0:
#lexer.sql.numbersign.comment=0

# Set to 1 to colourise recognized words with dots
# (recommended for Oracle PL/SQL objects)
#lexer.sql.allow.dotted.word=1

#lexer.sql.backticks.identifier=1

#fold.sql.at.else=1
#fold.sql.only.begin=1

keywords.$(file.patterns.sql)=\
absolute action add admin after aggregate \
alias all allocate alter and any are array as asc \
assertion at authorization \
before begin binary bit blob body boolean both breadth by \
call cascade cascaded case cast catalog char character \
check class clob close collate collation column commit \
completion connect connection constraint constraints \
constructor continue corresponding create cross cube current \
current_date current_path current_role current_time current_timestamp \
current_user cursor cycle \
data date datetime day deallocate dec decimal declare default \
deferrable deferred delete depth deref desc describe descriptor \
destroy destructor deterministic dictionary diagnostics disconnect \
distinct domain double drop dynamic \
each else end end-exec equals escape every except \
exception exec execute exists exit external \
false fetch first float for foreign found from free full \
function \
general get global go goto grant group grouping \
having host hour \
identity if ignore immediate in indicator initialize initially \
inner inout input insert int integer intersect interval \
into is isolation iterate \
join \
key \
language large last lateral leading left less level like \
limit local localtime localtimestamp locator \
map match merge minute modifies modify module month \
names national natural nchar nclob new next no none \
not null numeric \
object of off old on only open operation option \
or order ordinality out outer output \
package pad parameter parameters partial path postfix precision prefix \
preorder prepare preserve primary \
prior privileges procedure public \
read reads real recursive ref references referencing relative \
restrict result return returns revoke right \
role rollback rollup routine row rows \
savepoint schema scroll scope search second section select \
sequence session session_user set sets size smallint some| space \
specific specifictype sql sqlexception sqlstate sqlwarning start \
state statement static structure system_user \
table temporary terminate than then time timestamp \
timezone_hour timezone_minute to trailing transaction translation \
treat trigger true \
under union unique unknown \
unnest update usage user using \
value values varchar variable varying view \
when whenever where with without work write \
year \
zone

keywords.$(file.patterns.plsql)=\
all alter and any array as asc at authid avg begin between \
binary_integer \
body boolean bulk by char char_base check close cluster collect \
comment commit compress connect constant create current currval \
cursor date day declare decimal default delete desc distinct \
do drop else elsif end exception exclusive execute exists exit \
extends false fetch float for forall from function goto group \
having heap hour if immediate in index indicator insert integer \
interface intersect interval into is isolation java level like \
limited lock long loop max min minus minute mlslabel mod mode \
month natural naturaln new nextval nocopy not nowait null number \
number_base ocirowid of on opaque open operator option or order \
organization others out package partition pctfree pls_integer \
positive positiven pragma prior private procedure public raise \
range raw real record ref release return reverse rollback row \
rowid rownum rowtype savepoint second select separate set share \
smallint space sql sqlcode sqlerrm start stddev subtype successful \
sum synonym sysdate table then time timestamp to trigger true \
type uid union unique update use user validate values varchar \
varchar2 variance view when whenever where while with work write \
year zone

# Keywords for PlDoc comments
keywords3.$(file.patterns.sql)=\
param author since return see deprecated todo

# Keywords for SQL*Plus
keywords4.$(file.patterns.sql)=\
acc~ept a~ppend archive log attribute \
bre~ak bti~tle \
c~hange cl~ear col~umn comp~ute conn~ect copy \
def~ine del desc~ribe disc~onnect \
e~dit exec~ute exit \
get \
help ho~st \
i~nput \
l~ist \
passw~ord pau~se pri~nt pro~mpt \
quit \
recover rem~ark repf~ooter reph~eader r~un \
sav~e set sho~w shutdown spo~ol sta~rt startup store \
timi~ng tti~tle \
undef~ine \
var~iable \
whenever oserror whenever sqlerror \

# User keywords 1
# Keywords for Standard packages
keywords5.$(file.patterns.sql)=\
dbms_output.disable dbms_output.enable dbms_output.get_line \
dbms_output.get_lines dbms_output.new_line dbms_output.put \
dbms_output.put_line \


# Reserved Keywords for Apache Hive SQL
keywords.$(file.patterns.hql)=\
all alter and as authorization between both by \
case cast column conf create cross cube current \
cursor database delete describe distinct \
drop else end exchange exists extended external fetch following \
for from full function grant group grouping having if import in inner insert \
intersect interval into is join lateral left less like local macro map \
more not of on or order out outer over partialscan partition percent \
preceding preserve procedure range reads reduce revoke right rollup row rows \
select set table tablesample then to transform trigger \
truncate unbounded union uniquejoin update user using values \
when where window with commit only regexp rlike rollback start \
cache constraint foreign primary references \
extract floor precision views \
sync

# User keywords 2
# Reserved Keywords for Apache Hive SQL
keywords6.$(file.patterns.hql)=\
add admin after analyze archive asc before bucket buckets cascade change \
cluster clustered clusterstatus collection columns comment compact compactions \
compute concatenate continue data databases dbproperties deferred \
defined delimited dependency desc directories directory disable distribute \
elem_type enable escaped exclusive explain export fields file fileformat first \
format formatted functions hold_ddltime idxproperties ignore index \
indexes inpath inputdriver inputformat items jar keys key_type limit lines \
load location lock locks logical mapjoin materialized metadata minus \
msck noscan no_drop offline option outputdriver outputformat \
overwrite owner partitioned partitions plus pretty principals protection purge \
read readonly rebuild recordreader recordwriter regexp reload rename repair \
replace replication restrict rewrite rlike role roles schema schemas \
semi serde serdeproperties server sets shared show show_database skewed sort \
sorted ssl statistics stored streamtable tables tblproperties \
temporary terminated touch transactions unarchive undo uniontype \
unlock unset uri use utc value_type view while \
autocommit isolation level offset snapshot transaction work write \
abort key last norely novalidate nulls rely validate \
detail expression operator quarter summary vectorization \
zone

# User keywords 3
# Column/Field Types for Apache Hive SQL
keywords7.$(file.patterns.hql)=\
array bigint boolean char date decimal double float int smallint timestamp \
utc_tmestamp varchar integer time numeric \
datetime long string struct tinyint timestamptz unsigned utctimestamp

# Functions for Apache Hive SQL
keywords4.$(file.patterns.hql)=\
round floor ceil rand exp ln log10 log2 log pow sqrt bin hex unhex conv abs \
pmod sin asin cos acos tan atan degrees radians positive negative sign e pi \
size map_keys map_values array_contains sort_array \
binary cast \
from_unixtime unix_timestamp to_date datediff date_add date_sub \
from_utc_timestamp to_utc_timestamp \
day hour minute second month year weekofyear \
if case coalesce nullif \
ascii concat concat_ws context_ngrams find_in_set format_number \
get_json_object in_file instr length locate lower lpad ltrim ngrams parse_url \
printf regexp_extract regexp_replace repeat reverse rpad rtrim sentences \
space split str_to_map substr substring translate trim upper \
hash

# User keywords 4
# Constants Types for Apache Hive SQL
keywords8.$(file.patterns.hql)=\
current_timestamp false none null true dayofweek \
dow week years months weeks days hours minutes seconds \
orc csv parquet rc

# User keywords 1
# Reserved Keywords for Apache PIG
keywords.$(file.patterns.pig)=\
and any all arrange as asc by cache case \
%declare %default dense desc else end eval flatten full generate if \
inner input in into is left matches not onschema or outer output \
parallel partition returns right rollup ship stderr stdin stdout then \
through using when

# User keywords 2
# Operators for Apache PIG
keywords6.$(file.patterns.pig)=\
assert cogroup cross cube define distinct filter foreach group  import join \
limit load native order rank sample split set store stream union register

# User keywords 3
# Column/Field/Storage Types for Apache PIG
keywords7.$(file.patterns.pig)=\
int long float double chararray bytearray boolean datetime biginteger bigdecimal \
tuple bag map \
pigstorage pigdump jsonloader jsonstorage avrostorage orcstorage textloader \
hbasestorage trevnistorage accumulostorage

# User keywords 4
# Constants Types for Apache PIG
keywords8.$(file.patterns.pig)=\
true false null void

# Functions for Apache PIG
keywords4.$(file.patterns.pig)=\
avg bagtostring bagtotuple bloom buildbloom concat count count_star diff \
isempty max min plucktuple size subtract sum tokenize \
abs acos asin atan cbrt ceil cos cosh exp floor log log10 random round \
round_to sin sinh sqrt tan tanh \
endswith equalsignorecase indexof last_index_of lcfirst lower ltrim \
regex_extract regex_extract_all regex_search replace rtrim sprintf startswith \
strsplit strsplittobag substring trim ucfirst upper \
uniqueid addduration currenttime daysbetween getday gethour getmillisecond \
getminute getmonth getsecond getweek getweekyear getyear hoursbetween \
millisecondsbetween minutesbetween monthsbetween secondsbetween \
subtractduration todate tomilliseconds tostring tounixtime weeksbetween \
yearsbetween \
totuple tobag tomap top

# User keywords 1
# Commands for Apache PIG
keywords5.$(file.patterns.pig)=\
cat cd cp du ls mkdir mv pwd rm rmf \
copyfromlocal copytolocal pig \
fs sh clear exec help history kill quit run \
describe dump explain illustrate

