@bee.js/node 0.0.72 → 0.0.74

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.
Files changed (2) hide show
  1. package/beehive.js +8 -7
  2. package/package.json +1 -1
package/beehive.js CHANGED
@@ -44,17 +44,18 @@ module.exports = function hive(req = {}, res = {}, model = null) {
44
44
  } catch (_error) {
45
45
  log("####################### DB ERROR #######################");
46
46
  log(_error);
47
- log({ SQL, binds });
47
+ log(SQL);
48
+ log(binds.join(","));
48
49
 
49
- const isConnReset = _error?.message?.includes("ECONNRESET");
50
-
51
- if (isConnReset && retryCount < MAX_RETRIES) {
52
- log("### DB retry after ECONNRESET...");
50
+ if (_error?.message?.includes("ECONNRESET") && retryCount < MAX_RETRIES) {
51
+ log(
52
+ "####################### DB retry after ECONNRESET... #######################"
53
+ );
53
54
  global.beeDBPool = beeORM.createPool(global.configs);
54
55
  return await dbExec(SQL, binds, params, retryCount + 1);
55
56
  }
56
57
 
57
- throw _error; // error after MAX_RETRIES
58
+ return [];
58
59
  } finally {
59
60
  if (global.configs.debug) debug.push(SQL);
60
61
  if (global.configs.debug && binds) debug.push(binds);
@@ -274,7 +275,7 @@ module.exports = function hive(req = {}, res = {}, model = null) {
274
275
  ),
275
276
  ].join(",");
276
277
 
277
- script[0]["where"].push(`${model.table}.${field} IN(${array})`);
278
+ script[0]["where"].push(`${model.table}.${field} IN(${array ?? "null"})`);
278
279
 
279
280
  return this;
280
281
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bee.js/node",
3
- "version": "0.0.72",
3
+ "version": "0.0.74",
4
4
  "description": "A JavaScript framework for making Node.js API´s",
5
5
  "main": "index.js",
6
6
  "scripts": {