diff --git a/engine/engine/utils/dbHandler.js b/engine/engine/utils/dbHandler.js index 5329858..a4a45a3 100644 --- a/engine/engine/utils/dbHandler.js +++ b/engine/engine/utils/dbHandler.js @@ -72,10 +72,13 @@ module.exports = async function dbHandler({ query, values, database }) { */ try { results = await new Promise((resolve, reject) => { - if (values) { + if (values?.[0]) { connection.query(query, values, (error, results, fields) => { if (error) { - console.log("DB handler error:", error.message); + console.log("DB handler error with values array:", error.message); + console.log("SQL:", error.sql); + console.log("State:", error.sqlState, error.sqlMessage); + resolve({ error: error.message, }); @@ -91,6 +94,9 @@ module.exports = async function dbHandler({ query, values, database }) { connection.query(query, (error, results, fields) => { if (error) { console.log("DB handler error:", error.message); + console.log("SQL:", error.sql); + console.log("State:", error.sqlState, error.sqlMessage); + resolve({ error: error.message, }); diff --git a/package.json b/package.json index da9f048..adb51e1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "datasquirel", - "version": "1.5.9", + "version": "1.6.0", "description": "Cloud-based SQL data management tool", "main": "index.js", "bin": {