diff --git a/engine/engine/utils/varDatabaseDbHandler.js b/engine/engine/utils/varDatabaseDbHandler.js index 7b9b45e..8dfdfd5 100644 --- a/engine/engine/utils/varDatabaseDbHandler.js +++ b/engine/engine/utils/varDatabaseDbHandler.js @@ -44,9 +44,9 @@ module.exports = async function varDatabaseDbHandler({ queryString, queryValuesA * @description Fetch data from db if no cache */ try { - if (queryString && queryValuesArray && Array.isArray(queryValuesArray) && queryValuesArray[0]) { + if (queryString && Array.isArray(queryValuesArray) && queryValuesArray[0]) { results = await dbHandler({ query: queryString, values: queryValuesArray, database: database }); - } else { + } else if (queryString && !Array.isArray(queryValuesArray)) { results = await dbHandler({ query: queryString, database: database }); } diff --git a/engine/query/get.js b/engine/query/get.js index 9152abb..96d31fe 100644 --- a/engine/query/get.js +++ b/engine/query/get.js @@ -30,20 +30,11 @@ const runQuery = require("./utils/runQuery"); */ async function localGet({ options, dbSchema }) { try { - const { query } = options; + const { query, queryValues } = options; /** @type {string | undefined | any } */ const tableName = options?.tableName ? options.tableName : undefined; - /** @type {string[] | undefined } */ - let queryValues; - - if (options?.queryValues && typeof options?.queryValues === "string") { - try { - queryValues = JSON.parse(options.queryValues); - } catch (error) {} - } - const dbFullName = process.env.DSQL_DB_NAME || ""; /** diff --git a/package.json b/package.json index adb51e1..d802de6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.6.0", + "version": "1.6.1", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {