New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

flora-sql-parser

Package Overview
Dependencies
Maintainers
3
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flora-sql-parser - npm Package Compare versions

Comparing version 0.7.0 to 0.7.1

.idea/.name

2

Gruntfile.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc