foxhound 2.0.16 → 2.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/.nojekyll +0 -1
- package/docs/css/docuserve.css +73 -0
- package/docs/index.html +1 -1
- package/docs/retold-catalog.json +125 -0
- package/docs/retold-keyword-index.json +6358 -0
- package/package.json +1 -1
- package/source/dialects/SQLite/FoxHound-Dialect-SQLite.js +21 -4
- package/test/FoxHound-Dialect-SQLite_tests.js +2 -2
- package/dist/foxhound.js +0 -3020
- package/dist/foxhound.min.js +0 -15
- package/dist/foxhound.min.js.map +0 -1
package/package.json
CHANGED
|
@@ -211,12 +211,29 @@ var FoxHoundDialectSQLite = function(pFable)
|
|
|
211
211
|
// Close a logical grouping
|
|
212
212
|
tmpWhere += ' )';
|
|
213
213
|
}
|
|
214
|
-
else if (tmpFilter[i].Operator === 'IN')
|
|
214
|
+
else if (tmpFilter[i].Operator === 'IN' || tmpFilter[i].Operator === 'NOT IN')
|
|
215
215
|
{
|
|
216
216
|
tmpColumnParameter = tmpFilter[i].Parameter+'_w'+i;
|
|
217
|
-
//
|
|
218
|
-
|
|
219
|
-
|
|
217
|
+
// SQLite (better-sqlite3) cannot bind arrays as a single parameter.
|
|
218
|
+
// Expand the array into individual named parameters for each element.
|
|
219
|
+
var tmpFilterValue = tmpFilter[i].Value;
|
|
220
|
+
if (Array.isArray(tmpFilterValue))
|
|
221
|
+
{
|
|
222
|
+
var tmpParameterNames = [];
|
|
223
|
+
for (var j = 0; j < tmpFilterValue.length; j++)
|
|
224
|
+
{
|
|
225
|
+
var tmpElementParameter = tmpColumnParameter+'_'+j;
|
|
226
|
+
tmpParameterNames.push(':'+tmpElementParameter);
|
|
227
|
+
pParameters.query.parameters[tmpElementParameter] = tmpFilterValue[j];
|
|
228
|
+
}
|
|
229
|
+
tmpWhere += ' '+escapeColumn(tmpFilter[i].Column, pParameters)+' '+tmpFilter[i].Operator+' ( '+tmpParameterNames.join(', ')+' )';
|
|
230
|
+
}
|
|
231
|
+
else
|
|
232
|
+
{
|
|
233
|
+
// If for some reason the value is not an array, fall back to the old behavior
|
|
234
|
+
tmpWhere += ' '+escapeColumn(tmpFilter[i].Column, pParameters)+' '+tmpFilter[i].Operator+' ( :'+tmpColumnParameter+' )';
|
|
235
|
+
pParameters.query.parameters[tmpColumnParameter] = tmpFilterValue;
|
|
236
|
+
}
|
|
220
237
|
}
|
|
221
238
|
else if (tmpFilter[i].Operator === 'IS NOT NULL')
|
|
222
239
|
{
|
|
@@ -207,7 +207,7 @@ suite
|
|
|
207
207
|
// This is the query generated by the SQLite dialect
|
|
208
208
|
_Fable.log.trace('Select Query', tmpQuery.query);
|
|
209
209
|
Expect(tmpQuery.query.body)
|
|
210
|
-
.to.equal('SELECT `Name`, `Age`, `Cost` FROM Animal WHERE `Age` = :Age_w0 AND ( `Color` = :Color_w2 OR `Color` = :Color_w3 ) AND `Description` IS NOT NULL AND `IDOffice` IN ( :
|
|
210
|
+
.to.equal('SELECT `Name`, `Age`, `Cost` FROM Animal WHERE `Age` = :Age_w0 AND ( `Color` = :Color_w2 OR `Color` = :Color_w3 ) AND `Description` IS NOT NULL AND `IDOffice` IN ( :IDOffice_w6_0, :IDOffice_w6_1, :IDOffice_w6_2, :IDOffice_w6_3, :IDOffice_w6_4 ) ORDER BY `Age` LIMIT 100;');
|
|
211
211
|
}
|
|
212
212
|
);
|
|
213
213
|
test
|
|
@@ -655,7 +655,7 @@ suite
|
|
|
655
655
|
// This is the query generated by the SQLite dialect
|
|
656
656
|
_Fable.log.trace('Select Query', tmpQuery.query);
|
|
657
657
|
Expect(tmpQuery.query.body)
|
|
658
|
-
.to.equal('SELECT `Name`, `Age`, `Cost` FROM Animal WHERE `Age` = :Age_w0 AND ( `Color` = :Color_w2 OR `Color` = :Color_w3 ) AND `Description` IS NOT NULL AND `IDOffice` IN ( :
|
|
658
|
+
.to.equal('SELECT `Name`, `Age`, `Cost` FROM Animal WHERE `Age` = :Age_w0 AND ( `Color` = :Color_w2 OR `Color` = :Color_w3 ) AND `Description` IS NOT NULL AND `IDOffice` IN ( :IDOffice_w6_0, :IDOffice_w6_1, :IDOffice_w6_2, :IDOffice_w6_3, :IDOffice_w6_4 ) AND `Deleted` = :Deleted_w7 LIMIT 100;');
|
|
659
659
|
}
|
|
660
660
|
);
|
|
661
661
|
test
|