diff --git a/engine/db/add.js b/engine/db/add.js index f8f931c..6dd290d 100644 --- a/engine/db/add.js +++ b/engine/db/add.js @@ -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, diff --git a/engine/index.js b/engine/index.js index 6b18aa0..c5ba483 100644 --- a/engine/index.js +++ b/engine/index.js @@ -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; -/** ********************************************** */ -/** ********************************************** */ -/** ********************************************** */ +//////////////////////////////////////// +//////////////////////////////////////// +//////////////////////////////////////// diff --git a/index.js b/index.js index d700e66..30ca4fb 100644 --- a/index.js +++ b/index.js @@ -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; diff --git a/package.json b/package.json index f11274e..bd39e81 100644 --- a/package.json +++ b/package.json @@ -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": {