This commit is contained in:
Tben 2023-07-07 15:01:09 +01:00
parent dbd66baac3
commit 43a6271eed
4 changed files with 18 additions and 30 deletions

View File

@ -127,10 +127,6 @@ module.exports = async function add({ dbFullName, tableName, data, tableSchema,
const query = `INSERT INTO \`${tableName}\` (${insertKeysArray.join(",")}) VALUES (${insertValuesArray.map(() => "?").join(",")})`; const query = `INSERT INTO \`${tableName}\` (${insertKeysArray.join(",")}) VALUES (${insertValuesArray.map(() => "?").join(",")})`;
const queryValuesArray = insertValuesArray; const queryValuesArray = insertValuesArray;
// const newInsert = await dbHandler(query, queryValuesArray);
// const query = `INSERT INTO ${tableName} (${insertKeysArray.join(",")}) VALUES (${insertValuesArray.join(",")})`;
const newInsert = await handler({ const newInsert = await handler({
queryString: query, queryString: query,
database: dbFullName, database: dbFullName,

View File

@ -1,44 +1,34 @@
/** /**
* ==============================================================================
* Imports * Imports
* ============================================================================== * ===================================
*/ */
const imageInputFileToBase64 = require("./media/imageInputFileToBase64"); const add = require("./db/add");
const imageInputToBase64 = require("./media/imageInputToBase64"); const update = require("./db/update");
const inputFileToBase64 = require("./media/inputFileToBase64");
const getAccessToken = require("./auth/google/getAccessToken");
const logout = require("./auth/logout");
/** ****************************************************************************** */ ////////////////////////////////////////
/** ****************************************************************************** */ ////////////////////////////////////////
/** ****************************************************************************** */ ////////////////////////////////////////
/** ****************************************************************************** */
/** ****************************************************************************** */
/** ****************************************************************************** */
/** /**
* ==============================================================================
* Media Functions Object * Media Functions Object
* ============================================================================== * ===================================
*/ */
const db = { const db = {
add: imageInputToBase64, add: add,
imageInputFileToBase64: imageInputFileToBase64, update: update,
inputFileToBase64: inputFileToBase64, delete: update,
}; };
/** /**
* ==============================================================================
* Main Export * Main Export
* ============================================================================== * ===================================
*/ */
const dsqlEngine = { const dsqlEngine = {
media: media, db: db,
auth: auth,
}; };
module.exports = dsqlEngine; module.exports = dsqlEngine;
/** ********************************************** */ ////////////////////////////////////////
/** ********************************************** */ ////////////////////////////////////////
/** ********************************************** */ ////////////////////////////////////////

View File

@ -15,6 +15,7 @@ const reAuthUser = require("./users/reauth-user");
const getUser = require("./users/get-user"); const getUser = require("./users/get-user");
const loginWithGoogle = require("./users/social/google-auth"); const loginWithGoogle = require("./users/social/google-auth");
const sanitizeSql = require("./utils/functions/sanitizeSql"); const sanitizeSql = require("./utils/functions/sanitizeSql");
const dsqlEngine = require("./engine");
/** ****************************************************************************** */ /** ****************************************************************************** */
/** ****************************************************************************** */ /** ****************************************************************************** */
@ -61,6 +62,7 @@ const datasquirel = {
media: media, media: media,
user: user, user: user,
sanitizeSql: sanitizeSql, sanitizeSql: sanitizeSql,
engine: dsqlEngine,
}; };
module.exports = datasquirel; module.exports = datasquirel;

View File

@ -1,6 +1,6 @@
{ {
"name": "datasquirel", "name": "datasquirel",
"version": "1.1.60", "version": "1.1.61",
"description": "Cloud-based SQL data management tool", "description": "Cloud-based SQL data management tool",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {