From 7ff4ba13968b2d2cb5f5f9ef941ae5c67369893c Mon Sep 17 00:00:00 2001 From: Tben Date: Sat, 8 Jul 2023 17:14:47 +0100 Subject: [PATCH] updates --- engine/db/query.js | 5 +++++ engine/utils/dsqlDbHandler.js | 7 ++++++- package.json | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/engine/db/query.js b/engine/db/query.js index 63a9aa9..5748c30 100644 --- a/engine/db/query.js +++ b/engine/db/query.js @@ -62,6 +62,11 @@ async function query({ dbFullName, dbHost, dbPassword, dbUsername, query, values * Clean up */ await mysql.end(); + + /** + * Return error + */ + return error.message; } //////////////////////////////////////// diff --git a/engine/utils/dsqlDbHandler.js b/engine/utils/dsqlDbHandler.js index dd4f261..3055ab5 100644 --- a/engine/utils/dsqlDbHandler.js +++ b/engine/utils/dsqlDbHandler.js @@ -67,6 +67,11 @@ async function dsqlDbHandler({ queryString, queryValuesArray, database, tableSch * Clean up */ await mysql.end(); + + /** + * Return error + */ + return error.message; } /** @@ -87,7 +92,7 @@ async function dsqlDbHandler({ queryString, queryValuesArray, database, tableSch return JSON.parse(JSON.stringify(results)); } else { console.log("\x1b[31mDSQL Database Handler No results returned\x1b[0m =>", results); - return null; + return results; } } diff --git a/package.json b/package.json index 03b470f..1c7ee37 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.1.79", + "version": "1.1.80", "description": "Cloud-based SQL data management tool", "main": "index.js", "scripts": {