Upgrades
This commit is contained in:
parent
32785f9caa
commit
f0feaf508b
@ -44,9 +44,9 @@ module.exports = async function varDatabaseDbHandler({ queryString, queryValuesA
|
|||||||
* @description Fetch data from db if no cache
|
* @description Fetch data from db if no cache
|
||||||
*/
|
*/
|
||||||
try {
|
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 });
|
results = await dbHandler({ query: queryString, values: queryValuesArray, database: database });
|
||||||
} else {
|
} else if (queryString && !Array.isArray(queryValuesArray)) {
|
||||||
results = await dbHandler({ query: queryString, database: database });
|
results = await dbHandler({ query: queryString, database: database });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,20 +30,11 @@ const runQuery = require("./utils/runQuery");
|
|||||||
*/
|
*/
|
||||||
async function localGet({ options, dbSchema }) {
|
async function localGet({ options, dbSchema }) {
|
||||||
try {
|
try {
|
||||||
const { query } = options;
|
const { query, queryValues } = options;
|
||||||
|
|
||||||
/** @type {string | undefined | any } */
|
/** @type {string | undefined | any } */
|
||||||
const tableName = options?.tableName ? options.tableName : undefined;
|
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 || "";
|
const dbFullName = process.env.DSQL_DB_NAME || "";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "datasquirel",
|
"name": "datasquirel",
|
||||||
"version": "1.6.0",
|
"version": "1.6.1",
|
||||||
"description": "Cloud-based SQL data management tool",
|
"description": "Cloud-based SQL data management tool",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
Loading…
Reference in New Issue
Block a user