Skip to content

Commit eb639c1

Browse files
Gary Shengmarijnh
authored andcommitted
[sql mode] Add text/x-gql MIME type
1 parent 8f095df commit eb639c1

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

mode/sql/index.html

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@ <h2>SQL Mode for CodeMirror</h2>
5656
<code><a href="?mime=text/x-cassandra">text/x-cassandra</a></code>,
5757
<code><a href="?mime=text/x-plsql">text/x-plsql</a></code>,
5858
<code><a href="?mime=text/x-mssql">text/x-mssql</a></code>,
59-
<code><a href="?mime=text/x-hive">text/x-hive</a></code>.
60-
<code><a href="?mime=text/x-pgsql">text/x-pgsql</a></code>.
59+
<code><a href="?mime=text/x-hive">text/x-hive</a></code>,
60+
<code><a href="?mime=text/x-pgsql">text/x-pgsql</a></code>,
61+
<code><a href="?mime=text/x-gql">text/x-gql</a></code>.
6162
</p>
6263
<script>
6364
window.onload = function() {

mode/sql/sql.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,14 @@ CodeMirror.defineMode("sql", function(config, parserConfig) {
371371
support: set("ODBCdotTable decimallessFloat zerolessFloat binaryNumber hexNumber nCharCast charsetCast commentHash commentSpaceRequired")
372372
});
373373

374+
// Google's SQL-like query language, GQL
375+
CodeMirror.defineMIME("text/x-gql", {
376+
name: "sql",
377+
keywords: set("ancestor and asc by contains desc descendant distinct from group has in is limit offset on order select superset where"),
378+
atoms: set("false true"),
379+
builtin: set("blob datetime first key string integer double boolean null"),
380+
operatorChars: /^[*+\-%<>!=]/
381+
});
374382
}());
375383

376384
});

0 commit comments

Comments
 (0)