This commit is contained in:
Benjamin Toby 2025-04-23 14:40:16 +01:00
parent daad62141e
commit e7b7cf0314
3 changed files with 18 additions and 1 deletions

View File

@ -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 {

View File

@ -42,6 +42,7 @@ export default async function connDbHandler<ReturnType = any>(
label: "res",
});
}
return JSON.parse(JSON.stringify(res));
} else if (typeof query == "object") {
const resArray = [];
@ -86,6 +87,15 @@ export default async function connDbHandler<ReturnType = any>(
}
} 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();

View File

@ -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": {