Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sqlquerybuilder

Package Overview
Dependencies
Maintainers
1
Versions
77
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sqlquerybuilder - npm Package Compare versions

Comparing version 0.0.24 to 0.0.25

2

lib/selects.js

@@ -72,3 +72,3 @@ module.exports = function selects(self) {

if (tableName.indexOf('.') !== -1) {
if (tableName.indexOf('.') !== -1 && tableName[0] !== '(') {
var nameParts = tableName.split('.');

@@ -75,0 +75,0 @@

{
"name": "sqlquerybuilder",
"version": "0.0.24",
"version": "0.0.25",
"description": "Highly opinionated Sql Server Query Writer, mostly for internal use.",

@@ -5,0 +5,0 @@ "main": "./lib/index",

@@ -181,3 +181,10 @@ /**

it('It should be able to use a function as a select parameter', function (done) {
// var query = sqlBuilder().from('Items').selectJoin(q)
var queryObj ={
"Id": 'Key',
"(case (select fbs.Value from FieldbookSettings fbs where fbs.Name = 'ItemNumberingSettings.DisplayNumberInItemDropdowns') when 'True' then (Items.Number + ' - ' + Items.Name) else Items.Name end)": 'Value'
};
var query = sqlBuilder().from('Items').selectJoin(queryObj).where({IsActive: true}).build();
query.should.equal("SELECT Id AS 'Key', (case (select fbs.Value from FieldbookSettings fbs where fbs.Name = 'ItemNumberingSettings.DisplayNumberInItemDropdowns') when 'True' then (Items.Number + ' - ' + Items.Name) else Items.Name end) AS 'Value' FROM Items WHERE Items.IsActive = 1 ");
done();

@@ -184,0 +191,0 @@ });

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