jssql
Advanced tools
Comparing version 1.5.2 to 1.5.3
{ | ||
"name": "jssql", | ||
"description": "A simple javascript MySQL library", | ||
"version": "1.5.2", | ||
"version": "1.5.3", | ||
"author": "Avery Durrant <avery@frostbyte.co>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -126,2 +126,14 @@ ## Install | ||
### WHERE IN (...) | ||
A common use case of the WHERE clause in SQL is to find records that match one of a set of values. To do this, simply pass an array as the value for one of your where clauses. Below finds Products that have the ID of either 1 or 2 and a LOCATION_ID of 1. | ||
```js | ||
Products.find( | ||
{ | ||
ID: [1, 2], | ||
LOCATION_ID: 1 | ||
} | ||
); | ||
``` | ||
## "Advanced Find" | ||
@@ -128,0 +140,0 @@ If we want to do more advanced select statements, we are going to use the `findAdvanced` function. We use the first |
@@ -108,3 +108,5 @@ function QueryHelper() { | ||
keys += " AND " + key + " IS NULL"; | ||
} else { | ||
} else if (Array.isArray(properties[key]) ) { | ||
keys += " AND " + key + " IN (" + properties[key].join() + ")"; | ||
}else { | ||
keys += " AND " + key + " = ?"; | ||
@@ -111,0 +113,0 @@ values.push(properties[key]); |
58316
1376
329