Skip to content
Snippets Groups Projects
Commit c06c273a authored by Sarah McAlear and Wenlin Zhang's avatar Sarah McAlear and Wenlin Zhang Committed by Marijn Haverbeke
Browse files

[sql-mode] Add greenplum dialect as gpsql

parent 616116ba
No related branches found
No related tags found
No related merge requests found
......@@ -58,7 +58,8 @@ SELECT SQL_NO_CACHE DISTINCT
<code><a href="?mime=text/x-mssql">text/x-mssql</a></code>,
<code><a href="?mime=text/x-hive">text/x-hive</a></code>,
<code><a href="?mime=text/x-pgsql">text/x-pgsql</a></code>,
<code><a href="?mime=text/x-gql">text/x-gql</a></code>.
<code><a href="?mime=text/x-gql">text/x-gql</a></code>,
<code><a href="?mime=text/x-gpsql">text/x-gpsql</a></code>.
</p>
<script>
window.onload = function() {
......
......@@ -417,6 +417,19 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
builtin: set("blob datetime first key __key__ string integer double boolean null"),
operatorChars: /^[*+\-%<>!=]/
});
// Greenplum
CodeMirror.defineMIME("text/x-gpsql", {
name: "sql",
client: set("source"),
//https://github.com/greenplum-db/gpdb/blob/master/src/include/parser/kwlist.h
keywords: set("abort absolute access action active add admin after aggregate all also alter always analyse analyze and any array as asc assertion assignment asymmetric at authorization backward before begin between bigint binary bit boolean both by cache called cascade cascaded case cast chain char character characteristics check checkpoint class close cluster coalesce codegen collate column comment commit committed concurrency concurrently configuration connection constraint constraints contains content continue conversion copy cost cpu_rate_limit create createdb createexttable createrole createuser cross csv cube current current_catalog current_date current_role current_schema current_time current_timestamp current_user cursor cycle data database day deallocate dec decimal declare decode default defaults deferrable deferred definer delete delimiter delimiters deny desc dictionary disable discard distinct distributed do document domain double drop dxl each else enable encoding encrypted end enum errors escape every except exchange exclude excluding exclusive execute exists explain extension external extract false family fetch fields filespace fill filter first float following for force foreign format forward freeze from full function global grant granted greatest group group_id grouping handler hash having header hold host hour identity if ignore ilike immediate immutable implicit in including inclusive increment index indexes inherit inherits initially inline inner inout input insensitive insert instead int integer intersect interval into invoker is isnull isolation join key language large last leading least left level like limit list listen load local localtime localtimestamp location lock log login mapping master match maxvalue median merge minute minvalue missing mode modifies modify month move name names national natural nchar new newline next no nocreatedb nocreateexttable nocreaterole nocreateuser noinherit nologin none noovercommit nosuperuser not nothing notify notnull nowait null nullif nulls numeric object of off offset oids old on only operator option options or order ordered others out outer over overcommit overlaps overlay owned owner parser partial partition partitions passing password percent percentile_cont percentile_disc placing plans position preceding precision prepare prepared preserve primary prior privileges procedural procedure protocol queue quote randomly range read readable reads real reassign recheck recursive ref references reindex reject relative release rename repeatable replace replica reset resource restart restrict returning returns revoke right role rollback rollup rootpartition row rows rule savepoint scatter schema scroll search second security segment select sequence serializable session session_user set setof sets share show similar simple smallint some split sql stable standalone start statement statistics stdin stdout storage strict strip subpartition subpartitions substring superuser symmetric sysid system table tablespace temp template temporary text then threshold ties time timestamp to trailing transaction treat trigger trim true truncate trusted type unbounded uncommitted unencrypted union unique unknown unlisten until update user using vacuum valid validation validator value values varchar variadic varying verbose version view volatile web when where whitespace window with within without work writable write xml xmlattributes xmlconcat xmlelement xmlexists xmlforest xmlparse xmlpi xmlroot xmlserialize year yes zone"),
builtin: set("bigint int8 bigserial serial8 bit varying varbit boolean bool box bytea character char varchar cidr circle date double precision float float8 inet integer int int4 interval json jsonb line lseg macaddr macaddr8 money numeric decimal path pg_lsn point polygon real float4 smallint int2 smallserial serial2 serial serial4 text time without zone with timetz timestamp timestamptz tsquery tsvector txid_snapshot uuid xml"),
atoms: set("false true null unknown"),
operatorChars: /^[*+\-%<>!=&|^\/#@?~]/,
dateSQL: set("date time timestamp"),
support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast")
});
}());
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment