mysql-simple-query
Advanced tools
Comparing version 1.0.7 to 1.0.8
{ | ||
"name": "mysql-simple-query", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "Simple query wrapper for mysql-promise to make querying, inserting, updating, and deleting easier for developers.", | ||
@@ -5,0 +5,0 @@ "main": "mysqlSimpleQuery.js", |
@@ -12,2 +12,3 @@ const dbQuery = require('./util/dbQuery'); | ||
this.whereLikeStatement = {}; | ||
this.whereBetweenStatement = {}; | ||
this.whereLikeCondition = null; | ||
@@ -70,2 +71,10 @@ this.groupByStatement = ''; | ||
parseWhereBetween() { | ||
if(!isEmpty(this.whereBetweenStatement)) { | ||
return dbQuery.parseWhereBetween(this.whereBetweenStatement); | ||
} | ||
return ''; | ||
} | ||
groupBy(key) { | ||
@@ -123,2 +132,6 @@ if(key) | ||
if(this.parseWhereBetween() !== '') { | ||
queryStatement += ` ${this.parseWhereBetween()}`; | ||
} | ||
if(this.groupByStatement !== '') { | ||
@@ -125,0 +138,0 @@ queryStatement += ` ${this.groupByStatement}`; |
@@ -73,2 +73,13 @@ const select = (select) => { | ||
const parseWhereBetween = (whereObject) => { | ||
let whereStatement = []; | ||
for (let key of Object.keys(whereObject)) { | ||
const value = whereObject[key]; | ||
whereStatement.push(`${key} BETWEEN "${value}"`); | ||
} | ||
return `${whereStatement.join(' AND ')}`; | ||
}; | ||
const groupBy = (key) => { | ||
@@ -127,2 +138,3 @@ if(key) | ||
parseWhereLike, | ||
parseWhereBetween, | ||
groupBy, | ||
@@ -129,0 +141,0 @@ orderBy, |
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
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
27849
712