Socket
Socket
Sign inDemoInstall

node-querybuilder

Package Overview
Dependencies
12
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.2.0 to 1.2.1

2

package.json
{
"name": "node-querybuilder",
"version": "1.2.0",
"version": "1.2.1",
"author": "Kyle Farris <kyle@chomponllc.com>",

@@ -5,0 +5,0 @@ "description": "Modeled after Codeigniter's QueryBuilder. Build and execute queries in a safe and database-agnostic way.",

@@ -139,3 +139,3 @@ const should = require('chai').should();

});
it('should not allow subqueries or functions with commas in them without the second parameter being false', () => {
it('should not allow subqueries without the second parameter being false', () => {
qb.reset_query();

@@ -147,5 +147,27 @@ expect(

expect(
() => qb.select('s.star_systems, (select count(p.*) as count from planets p where p.star_system_id IN(2,3,5)) as num_planets',false)
() => qb.select('s.star_systems, (select count(p.*) as count from planets p where p.star_system_id = 42) as num_planets')
).to.throw(Error);
expect(
() => qb.select('s.star_systems, (select count(p.*) as count from planets p where p.star_system_id IN(2,3,5)) as num_planets', false)
).to.not.throw(Error);
});
it('should not allow functions without the second paramter being false', () => {
expect(
() => qb.select('s.star_systems, count(planets) as num_planets')
).to.throw(Error);
expect(
() => qb.select('s.star_systems, if(num_planets > 0, true, false) as has_planets')
).to.throw(Error);
expect(
() => qb.select('s.star_systems, count(planets) as num_planets', false)
).to.not.throw(Error);
expect(
() => qb.select('s.star_systems, if(num_planets > 0, true, false) as has_planets', false)
).to.not.throw(Error);
});
it('should allow for functions and subqueries in statement without escaping them (aliases at the end will still be escaped)', () => {

@@ -186,2 +208,2 @@ qb.reset_query();

});
}
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc