updates
This commit is contained in:
parent
9cc5dc245a
commit
3d59792fad
@ -1,3 +1,17 @@
|
||||
/** # MODULE TRACE
|
||||
======================================================================
|
||||
* Detected 8 files that call this module. The files are listed below:
|
||||
======================================================================
|
||||
* `require` Statement Found in [noDatabaseDbHandler.js](d:\GitHub\dsql\engine\engine\utils\noDatabaseDbHandler.js)
|
||||
* `require` Statement Found in [varDatabaseDbHandler.js](d:\GitHub\dsql\engine\engine\utils\varDatabaseDbHandler.js)
|
||||
* `require` Statement Found in [addDbEntry.js](d:\GitHub\dsql\engine\query\utils\addDbEntry.js)
|
||||
* `require` Statement Found in [deleteDbEntry.js](d:\GitHub\dsql\engine\query\utils\deleteDbEntry.js)
|
||||
* `require` Statement Found in [runQuery.js](d:\GitHub\dsql\engine\query\utils\runQuery.js)
|
||||
* `require` Statement Found in [updateDbEntry.js](d:\GitHub\dsql\engine\query\utils\updateDbEntry.js)
|
||||
* `require` Statement Found in [githubLogin.js](d:\GitHub\dsql\engine\user\social\utils\githubLogin.js)
|
||||
* `require` Statement Found in [googleLogin.js](d:\GitHub\dsql\engine\user\social\utils\googleLogin.js)
|
||||
==== MODULE TRACE END ==== */
|
||||
|
||||
// @ts-check
|
||||
|
||||
////////////////////////////////////////
|
||||
@ -6,6 +20,7 @@
|
||||
|
||||
const fs = require("fs");
|
||||
const mysql = require("mysql");
|
||||
const parseDbResults = require("./parseDbResults");
|
||||
|
||||
const connection = mysql.createConnection({
|
||||
host: process.env.DSQL_HOST,
|
||||
@ -31,12 +46,13 @@ const connection = mysql.createConnection({
|
||||
* @param {object} params - Single Param object containing params
|
||||
* @param {string} params.query - Query String
|
||||
* @param {(string | number)[]} [params.values] - Values
|
||||
* @param {object} [params.dbSchema] - Database Schema
|
||||
* @param {import("../../../types/database-schema.td").DSQL_DatabaseSchemaType} [params.dbSchema] - Database Schema
|
||||
* @param {string} [params.database] - Target Database
|
||||
* @param {string} [params.tableName] - Target Table Name
|
||||
*
|
||||
* @returns {Promise<*>}
|
||||
*/
|
||||
module.exports = async function dbHandler({ query, values, database }) {
|
||||
module.exports = async function dbHandler({ query, values, database, dbSchema, tableName }) {
|
||||
/**
|
||||
* Declare variables
|
||||
*
|
||||
@ -123,6 +139,15 @@ module.exports = async function dbHandler({ query, values, database }) {
|
||||
*
|
||||
* @description Return results add to cache if "req" param is passed
|
||||
*/
|
||||
// if (results && dbSchema && tableName) {
|
||||
// const tableSchema = dbSchema.tables.find((table) => table.tableName === tableName);
|
||||
// const parsedResults = parseDbResults({
|
||||
// unparsedResults: results,
|
||||
// tableSchema: tableSchema,
|
||||
// });
|
||||
|
||||
// return parsedResults;
|
||||
// } else
|
||||
if (results) {
|
||||
return results;
|
||||
} else {
|
||||
|
@ -1,3 +1,18 @@
|
||||
/** # MODULE TRACE
|
||||
======================================================================
|
||||
* Detected 9 files that call this module. The files are listed below:
|
||||
======================================================================
|
||||
* `require` Statement Found in [createDbFromSchema.js](d:\GitHub\dsql\engine\engine\createDbFromSchema.js)
|
||||
* `require` Statement Found in [updateTable.js](d:\GitHub\dsql\engine\engine\utils\updateTable.js)
|
||||
* `require` Statement Found in [runQuery.js](d:\GitHub\dsql\engine\query\utils\runQuery.js)
|
||||
* `require` Statement Found in [add-user.js](d:\GitHub\dsql\engine\user\add-user.js)
|
||||
* `require` Statement Found in [get-user.js](d:\GitHub\dsql\engine\user\get-user.js)
|
||||
* `require` Statement Found in [login-user.js](d:\GitHub\dsql\engine\user\login-user.js)
|
||||
* `require` Statement Found in [reauth-user.js](d:\GitHub\dsql\engine\user\reauth-user.js)
|
||||
* `require` Statement Found in [handleSocialDb.js](d:\GitHub\dsql\engine\user\social\utils\handleSocialDb.js)
|
||||
* `require` Statement Found in [update-user.js](d:\GitHub\dsql\engine\user\update-user.js)
|
||||
==== MODULE TRACE END ==== */
|
||||
|
||||
// @ts-check
|
||||
|
||||
const fs = require("fs");
|
||||
|
@ -1,3 +1,8 @@
|
||||
/** # MODULE TRACE
|
||||
======================================================================
|
||||
* No imports found for this Module
|
||||
==== MODULE TRACE END ==== */
|
||||
|
||||
// @ts-check
|
||||
|
||||
const runQuery = require("./utils/runQuery");
|
||||
@ -63,7 +68,7 @@ async function localGet({ options, dbSchema }) {
|
||||
});
|
||||
|
||||
if (error) throw error;
|
||||
if (result.error) throw new Error(result.error);
|
||||
if (result?.error) throw new Error(result.error);
|
||||
|
||||
results = result;
|
||||
return { success: true, payload: results };
|
||||
@ -74,7 +79,11 @@ async function localGet({ options, dbSchema }) {
|
||||
|
||||
console.log("Error in local get Request =>", error.message);
|
||||
|
||||
return { success: false, payload: null, error: error.message };
|
||||
return {
|
||||
success: false,
|
||||
payload: null,
|
||||
error: error.message,
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////
|
||||
|
@ -1,3 +1,13 @@
|
||||
/** # MODULE TRACE
|
||||
======================================================================
|
||||
* Detected 4 files that call this module. The files are listed below:
|
||||
======================================================================
|
||||
* `require` Statement Found in [get.js](d:\GitHub\dsql\engine\query\get.js)
|
||||
* `require` Statement Found in [post.js](d:\GitHub\dsql\engine\query\post.js)
|
||||
* `require` Statement Found in [add-user.js](d:\GitHub\dsql\engine\user\add-user.js)
|
||||
* `require` Statement Found in [update-user.js](d:\GitHub\dsql\engine\user\update-user.js)
|
||||
==== MODULE TRACE END ==== */
|
||||
|
||||
// @ts-check
|
||||
|
||||
const fs = require("fs");
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "datasquirel",
|
||||
"version": "1.7.9",
|
||||
"version": "1.8.0",
|
||||
"description": "Cloud-based SQL data management tool",
|
||||
"main": "index.js",
|
||||
"bin": {
|
||||
|
Loading…
Reference in New Issue
Block a user