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 queryValuesArray = insertValuesArray;
// const newInsert = await dbHandler(query, queryValuesArray);
// const query = `INSERT INTO ${tableName} (${insertKeysArray.join(",")}) VALUES (${insertValuesArray.join(",")})`;
const newInsert = await handler({
queryString: query,
database: dbFullName,

View File

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

View File

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

View File

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