flora-sql-parser
Advanced tools
Comparing version 0.7.0 to 0.7.1
@@ -40,3 +40,3 @@ 'use strict'; | ||
createParser: { | ||
cmd: './node_modules/.bin/pegjs sql.pegjs pegjs-parser.js' | ||
cmd: './node_modules/.bin/pegjs -o pegjs-parser.js sql.pegjs' | ||
} | ||
@@ -43,0 +43,0 @@ }, |
@@ -182,10 +182,12 @@ 'use strict'; | ||
/** | ||
* @param {Object} stmt | ||
* @param {?Array} stmt.options | ||
* @param {?string} stmt.distinct | ||
* @param {?Array} stmt.columns | ||
* @param {?Array} stmt.from | ||
* @param {?Array} stmt.groupby | ||
* @param {?Array} stmt.orderby | ||
* @param {?Array} stmt.limit | ||
* @param {Object} stmt | ||
* @param {?Array} stmt.options | ||
* @param {?string} stmt.distinct | ||
* @param {?Array|string} stmt.columns | ||
* @param {?Array} stmt.from | ||
* @param {?Object} stmt.where | ||
* @param {?Array} stmt.groupby | ||
* @param {?Object} stmt.having | ||
* @param {?Array} stmt.orderby | ||
* @param {?Array} stmt.limit | ||
* @return {string} | ||
@@ -192,0 +194,0 @@ */ |
{ | ||
"name": "flora-sql-parser", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"description": "Parse SQL (select) statements into abstract syntax tree (AST) and convert ASTs back to SQL.", | ||
"main": "index.js", | ||
"scripts": { | ||
"install": "./node_modules/.bin/pegjs sql.pegjs pegjs-parser.js", | ||
"install": "./node_modules/.bin/pegjs -o pegjs-parser.js sql.pegjs", | ||
"test": "./node_modules/.bin/grunt test", | ||
@@ -43,3 +43,3 @@ "lint": "grunt lint" | ||
"has": "^1.0.1", | ||
"pegjs": "^0.9.0" | ||
"pegjs": "^0.10.0" | ||
}, | ||
@@ -46,0 +46,0 @@ "devDependencies": { |
@@ -213,2 +213,9 @@ 'use strict'; | ||
['IS', 'IS NOT'].forEach(function (operator) { | ||
it('should support ' + operator + ' operator', function () { | ||
sql = 'SELECT a FROM t WHERE col ' + operator.toLowerCase() + ' NULL'; | ||
expect(getParsedSql(sql)).to.equal('SELECT "a" FROM "t" WHERE "col" ' + operator + ' NULL'); | ||
}); | ||
}); | ||
it('should support BETWEEN operator', function () { | ||
@@ -215,0 +222,0 @@ sql = 'SELECT a FROM t WHERE id between \'1\' and 1337'; |
@@ -242,2 +242,15 @@ 'use strict'; | ||
['is', 'is not'].forEach(function (operator) { | ||
it('should parse condition', function () { | ||
ast = parser.parse('SELECT * FROM t WHERE "col" ' + operator + ' NULL'); | ||
expect(ast.where).to.eql({ | ||
type: 'binary_expr', | ||
operator: operator.toUpperCase(), | ||
left: { type: 'column_ref', table: null, column: 'col' }, | ||
right: { type: 'null', value: null } | ||
}); | ||
}); | ||
}); | ||
['exists', 'not exists'].forEach(function (operator) { | ||
@@ -244,0 +257,0 @@ it('should parse ' + operator.toUpperCase() + ' condition', function () { |
Sorry, the diff of this file is not supported yet
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
129109
30
1142
1
+ Addedpegjs@0.10.0(transitive)
- Removedpegjs@0.9.0(transitive)
Updatedpegjs@^0.10.0