Skip to content

Commit 0c328f6

Browse files
committed
Add SQL keywords
1 parent 5b07199 commit 0c328f6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

static/js/codemirror-addon/mpg-hint.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
while (start && word.test(curLine.charAt(start - 1))) --start;
2323
var curWord = start != end && curLine.slice(start, end);
2424

25-
options.list = MPG.mongoDBKeywords.concat(MPG.collectionFields);
25+
options.list = MPG.mongoDBAndSQLKeywords.concat(MPG.collectionFields);
2626

2727
/**
2828
* Code block taken from Mongolo project.

static/js/mpg.database.query.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,17 @@ MPG.databaseName = '';
2828
MPG.collectionName = '';
2929

3030
/**
31-
* List of MongoDB keywords.
31+
* List of MongoDB and SQL keywords.
3232
* XXX Used for autocompletion.
3333
*
3434
* @type {Array}
3535
*/
36-
MPG.mongoDBKeywords = [
36+
MPG.mongoDBAndSQLKeywords = [
3737

3838
'$eq', '$gt', '$gte', '$in', '$lt', '$lte', '$ne', '$nin',
39-
'$and', '$not', '$nor', '$or', '$exists', '$type'
39+
'$and', '$not', '$nor', '$or', '$exists', '$type',
40+
41+
'SELECT', 'FROM', 'WHERE', 'IN', 'LIKE', 'AND', 'NOT', 'OR'
4042

4143
];
4244

0 commit comments

Comments
 (0)