@bee.js/node 0.0.86 → 0.0.88
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/beehive.js +23 -22
- package/lib/ORM/beeORM.js +0 -4
- package/package.json +1 -1
package/beehive.js
CHANGED
|
@@ -262,29 +262,30 @@ module.exports = function hive(req = {}, res = {}, model = null) {
|
|
|
262
262
|
},
|
|
263
263
|
|
|
264
264
|
whereIn: function (field, array = []) {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
].join(",");
|
|
265
|
+
const values = {};
|
|
266
|
+
|
|
267
|
+
array.map((row) => {
|
|
268
|
+
const val = row[field];
|
|
269
|
+
|
|
270
|
+
if (!!!val) return;
|
|
271
|
+
|
|
272
|
+
switch (model.schema[field]?.type) {
|
|
273
|
+
case "char":
|
|
274
|
+
case "varchar":
|
|
275
|
+
case "text":
|
|
276
|
+
case "string":
|
|
277
|
+
return (values[`'${val}'`] = true);
|
|
278
|
+
case "guid":
|
|
279
|
+
case "uuid":
|
|
280
|
+
return (values[beeTools.guidToBin(val) ?? "null"] = true);
|
|
281
|
+
default:
|
|
282
|
+
return (values[val] = true);
|
|
283
|
+
}
|
|
284
|
+
});
|
|
286
285
|
|
|
287
|
-
script[0]["where"].push(
|
|
286
|
+
script[0]["where"].push(
|
|
287
|
+
`${model.table}.${field} IN(${Object.keys(values).join(",") ?? "null"})`
|
|
288
|
+
);
|
|
288
289
|
|
|
289
290
|
return this;
|
|
290
291
|
},
|
package/lib/ORM/beeORM.js
CHANGED
|
@@ -252,13 +252,9 @@ module.exports = {
|
|
|
252
252
|
break;
|
|
253
253
|
case "date":
|
|
254
254
|
case "datetime":
|
|
255
|
-
case "time":
|
|
256
|
-
case "timestamp":
|
|
257
255
|
binds.push(normalizeDate(value));
|
|
258
256
|
value = "?";
|
|
259
257
|
break;
|
|
260
|
-
case "binary":
|
|
261
|
-
case "file":
|
|
262
258
|
default:
|
|
263
259
|
binds.push(value);
|
|
264
260
|
value = "?";
|