From 82cacd6a15ba22517d71da401abc5bd50db08180 Mon Sep 17 00:00:00 2001 From: Benjamin Toby Date: Wed, 6 Nov 2024 12:23:58 +0100 Subject: [PATCH] Updates and Bugfixes --- engine/query/post.js | 15 +++------------ package.json | 2 +- utils/post.js | 17 +++++------------ 3 files changed, 9 insertions(+), 25 deletions(-) diff --git a/engine/query/post.js b/engine/query/post.js index ab0f4a0..cd19315 100644 --- a/engine/query/post.js +++ b/engine/query/post.js @@ -8,10 +8,10 @@ const runQuery = require("../../package-shared/functions/backend/db/runQuery"); * @async * * @param {Object} params - Single object passed - * @param {import("../../package-shared/types").LocalPostQueryObject} params.options - SQL Query - * @param {import("../../package-shared/types").DSQL_DatabaseSchemaType | undefined} [params.dbSchema] - Name of the table to query + * @param {import("../../package-shared/types").LocalPostQueryObject} params.options + * @param {import("../../package-shared/types").DSQL_DatabaseSchemaType | undefined} [params.dbSchema] * - * @returns { Promise } - Return Object + * @returns { Promise } */ async function localPost({ options, dbSchema }) { try { @@ -62,28 +62,19 @@ async function localPost({ options, dbSchema }) { payload: result, error: error, }; - - //////////////////////////////////////// } catch (/** @type {*} */ error) { - //////////////////////////////////////// - return { success: false, error: error.message, }; } - - //////////////////////////////////////// } catch (/** @type {*} */ error) { - //////////////////////////////////////// console.log("Error in local post Request =>", error.message); return { success: false, msg: "Something went wrong!", }; - - //////////////////////////////////////// } } diff --git a/package.json b/package.json index 1c38e3e..236b081 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "2.3.7", + "version": "2.3.8", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": { diff --git a/utils/post.js b/utils/post.js index 1807aef..28e1051 100644 --- a/utils/post.js +++ b/utils/post.js @@ -46,20 +46,13 @@ async function post({ key, query, queryValues, database, tableName }) { * * @description Look for local db settings in `.env` file and by pass the http request if available */ - const { - DSQL_HOST, - DSQL_USER, - DSQL_PASS, - DSQL_DB_NAME, - DSQL_KEY, - DSQL_REF_DB_NAME, - DSQL_FULL_SYNC, - } = process.env; + const { DSQL_DB_HOST, DSQL_DB_USERNAME, DSQL_DB_PASSWORD, DSQL_DB_NAME } = + process.env; if ( - DSQL_HOST?.match(/./) && - DSQL_USER?.match(/./) && - DSQL_PASS?.match(/./) && + DSQL_DB_HOST?.match(/./) && + DSQL_DB_USERNAME?.match(/./) && + DSQL_DB_PASSWORD?.match(/./) && DSQL_DB_NAME?.match(/./) ) { /** @type {import("../package-shared/types").DSQL_DatabaseSchemaType | undefined} */