From e7b7cf0314b7bf167f40266a4f9996d3fd796693 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Wed, 23 Apr 2025 14:40:16 +0100 Subject: [PATCH] Updates --- dist/package-shared/utils/db/conn-db-handler.js | 7 +++++++ package-shared/utils/db/conn-db-handler.ts | 10 ++++++++++ package.json | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/dist/package-shared/utils/db/conn-db-handler.js b/dist/package-shared/utils/db/conn-db-handler.js index 0d6c9bd..9a6568a 100644 --- a/dist/package-shared/utils/db/conn-db-handler.js +++ b/dist/package-shared/utils/db/conn-db-handler.js @@ -85,6 +85,13 @@ values, debug) { } catch (error) { (_b = global.ERROR_CALLBACK) === null || _b === void 0 ? void 0 : _b.call(global, `Connection DB Handler Error`, error); + if (debug) { + (0, debug_log_1.default)({ + log: `Connection DB Handler Error: ${error.message}`, + addTime: true, + label: "Error", + }); + } return null; } finally { diff --git a/package-shared/utils/db/conn-db-handler.ts b/package-shared/utils/db/conn-db-handler.ts index 3061196..d77c43b 100644 --- a/package-shared/utils/db/conn-db-handler.ts +++ b/package-shared/utils/db/conn-db-handler.ts @@ -42,6 +42,7 @@ export default async function connDbHandler( label: "res", }); } + return JSON.parse(JSON.stringify(res)); } else if (typeof query == "object") { const resArray = []; @@ -86,6 +87,15 @@ export default async function connDbHandler( } } catch (error: any) { global.ERROR_CALLBACK?.(`Connection DB Handler Error`, error as Error); + + if (debug) { + debugLog({ + log: `Connection DB Handler Error: ${error.message}`, + addTime: true, + label: "Error", + }); + } + return null; } finally { conn?.end(); diff --git a/package.json b/package.json index 9aab264..e9d33c3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@moduletrace/datasquirel", - "version": "4.4.7", + "version": "4.4.8", "description": "Cloud-based SQL data management tool", "main": "dist/index.js", "bin": {