This commit is contained in:
Tben 2023-08-12 17:18:34 +01:00
parent cc65ea23b8
commit 32785f9caa
2 changed files with 9 additions and 3 deletions

View File

@ -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,
});

View File

@ -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": {