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.25 to 0.0.26

4

lib/pagingAndLists.js

@@ -15,2 +15,6 @@ module.exports = function pagingAndLists(self) {

self.processListRequest = function processListRequest(reqquery) {
if(reqquery.query){
reqquery = reqquery.query;
}
if (reqquery.filters) {

@@ -17,0 +21,0 @@ self.whereFilters(reqquery.filters);

2

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

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

@@ -562,2 +562,53 @@ /**

});
it('Should filter by contains properly', function (done) {
var reqquery ={ filters: 'InvoiceCustomerName.Contains("EOG Re")&&IsActive=true',
sidx: 'InvoiceNumber',
sord: 'asc',
RenderFormat: 'paged',
page: '1',
pagePercent: '0.3333333333333333',
total: '205',
rows: '100',
totalPages: '3' };
var req = { query: reqquery };
var query = sqlBuilder().from('InvoiceSalesTaxInfoView')
.select({
Id: null,
Created: null,
LastModified: null,
IsActive: null,
ModifiedBy: null,
'TotalTax':null,
'Total':null,
'TaxableTotal':null,
'NonTaxableTotal':null,
TaxRate:null,
InvoiceNumber:null,
InvoiceCustomerName:null,
InvoiceYard:null,
InvoiceDate:null,
InvoiceStateDisplayName:'InvoiceState.DisplayName',
InvoiceStateValue:'InvoiceState.Value',
StatusDisplayName:'Status.DisplayName',
StatusValue:'Status.Value',
InvoiceIsProcessed:null,
SalesTaxZoneState:null,
SalesTaxZoneName:null
})
.processListRequest(req)
.build();
query.should
.equal("WITH SelectedItems AS (SELECT Id, Created, LastModified, IsActive, ModifiedBy, TotalTax, Total, TaxableTotal, NonTaxableTotal, TaxRate, InvoiceNumber, InvoiceCustomerName, InvoiceYard, InvoiceDate, InvoiceStateDisplayName AS 'InvoiceState.DisplayName', InvoiceStateValue AS 'InvoiceState.Value', StatusDisplayName AS 'Status.DisplayName', StatusValue AS 'Status.Value', InvoiceIsProcessed, SalesTaxZoneState, SalesTaxZoneName, ROW_NUMBER() OVER (ORDER BY InvoiceNumber ASC) AS Position FROM InvoiceSalesTaxInfoView WHERE InvoiceCustomerName LIKE '%EOG Re%' AND InvoiceSalesTaxInfoView.IsActive = 1) SELECT *, (Select MAX(Position) From SelectedItems) as 'TotalRows' FROM SelectedItems WHERE Position > 0 AND Position <= 100 ")
done();
});
});
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