mysql-simple-query
Advanced tools
Comparing version 1.0.8 to 1.0.9
@@ -11,2 +11,3 @@ const dbQuery = require('./util/dbQuery'); | ||
this.whereLikeStatement = {}; | ||
this.whereBetweenStatement = {}; | ||
this.whereLikeCondition = null; | ||
@@ -69,2 +70,10 @@ this.groupByStatement = ''; | ||
parseWhereBetween() { | ||
if (!isEmpty(this.whereBetweenStatement)) { | ||
return dbQuery.parseWhereBetween(this.whereBetweenStatement); | ||
} | ||
return ''; | ||
} | ||
groupBy(key) { | ||
@@ -120,2 +129,6 @@ if (key) { | ||
if (this.parseWhereBetween() !== '') { | ||
queryStatement += ` ${this.parseWhereBetween()}`; | ||
} | ||
if (this.groupByStatement !== '') { | ||
@@ -122,0 +135,0 @@ queryStatement += ` ${this.groupByStatement}`; |
@@ -68,2 +68,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 => { | ||
@@ -118,2 +129,3 @@ if (key) { | ||
parseWhereLike, | ||
parseWhereBetween, | ||
groupBy, | ||
@@ -120,0 +132,0 @@ orderBy, |
{ | ||
"name": "mysql-simple-query", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Simple query wrapper for mysql-promise to make querying, inserting, updating, and deleting easier for developers.", | ||
@@ -5,0 +5,0 @@ "main": "mysqlSimpleQuery.js", |
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
28498
731