sqlquerybuilder
Advanced tools
Comparing version 0.0.57 to 0.0.58
@@ -194,5 +194,9 @@ var uuid = require('node-uuid'), pluralizer = require('pluralizer'), _ = require('lodash'); | ||
self._isDateTimeField = function(fieldName) { | ||
return ((fieldName.indexOf("Date") != -1 || fieldName.indexOf("Time") != -1 || | ||
options.dateTimeInclusions.indexOf(fieldName) != -1) && | ||
options.dateTimeExclusions.indexOf(fieldName) == -1); | ||
return (fieldName.indexOf("Date") != -1 || fieldName.indexOf("Time") != -1 || | ||
_.find(options.dateTimeInclusions, function(inclusion) { | ||
return fieldName.indexOf(inclusion) != -1; | ||
})) && | ||
! _.find(options.dateTimeExclusions, function(exclusion) { | ||
return fieldName.indexOf(exclusion) != -1; | ||
}); | ||
}; | ||
@@ -199,0 +203,0 @@ |
{ | ||
"name": "sqlquerybuilder", | ||
"version": "0.0.57", | ||
"version": "0.0.58", | ||
"description": "Highly opinionated Sql Server Query Writer, mostly for internal use.", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index", |
@@ -1,8 +0,8 @@ | ||
/** | ||
* Created by jordan.cotter on 9/12/2014. | ||
*/ | ||
var sqlQueryBuilder = require('../../../lib/index'), | ||
sqlBuilder = sqlQueryBuilder.queryBuilder; | ||
var sqlBuilder = require('../../../lib/index').queryBuilder; | ||
describe('When calling WHERE, valid sql should be produced when', function(){ | ||
before(function () { | ||
sqlQueryBuilder.init({}); | ||
}); | ||
@@ -396,2 +396,11 @@ //WHERE STRING | ||
}); | ||
it('given a field in the date-exclusion list with a table alias', function(done){ | ||
(sqlBuilder().select("Id, GLAccount_id") | ||
.from("Reconciliations r") | ||
.where({"r.GLEffectiveDate_id": '1'}) | ||
.where({StatusValue: 2}) | ||
.build()).should.equal("SELECT Id, GLAccount_id FROM Reconciliations r WHERE r.GLEffectiveDate_id = '1' AND r.StatusValue = 2 "); | ||
done(); | ||
}); | ||
}); |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
239347
4777