undo mysql change again

This commit is contained in:
Dave Conway-Jones 2021-03-14 17:54:31 +00:00
parent 3330053a1c
commit fabd3753b4
No known key found for this signature in database
GPG Key ID: 88BA2B8A411BE9FF
2 changed files with 6 additions and 6 deletions

View File

@ -128,7 +128,7 @@ module.exports = function(RED) {
var bind = []; var bind = [];
if (Array.isArray(msg.payload)) { bind = msg.payload; } if (Array.isArray(msg.payload)) { bind = msg.payload; }
else if (typeof msg.payload === 'object' && msg.payload !== null) { else if (typeof msg.payload === 'object' && msg.payload !== null) {
bind=msg.payload; bind = msg.payload;
node.mydbConfig.connection.config.queryFormat = function(query, values) { node.mydbConfig.connection.config.queryFormat = function(query, values) {
if (!values) { if (!values) {
return query; return query;
@ -148,7 +148,7 @@ module.exports = function(RED) {
node.error(err,msg); node.error(err,msg);
} }
else { else {
if ( (rows.constructor.name === "OkPacket") || (rows.constructor.name === "Array")) { if ((rows.constructor.name === "OkPacket") || (rows.constructor.name === "Array")) {
msg.payload = JSON.parse(JSON.stringify(rows)); msg.payload = JSON.parse(JSON.stringify(rows));
} }
else { msg.payload = rows; } else { msg.payload = rows; }
@ -156,9 +156,9 @@ module.exports = function(RED) {
status = {fill:"green",shape:"dot",text:"OK"}; status = {fill:"green",shape:"dot",text:"OK"};
node.status(status); node.status(status);
} }
if (node.mydbConfig.pool._freeConnections.indexOf(node.mydbConfig.connection) === -1) { // if (node.mydbConfig.pool._freeConnections.indexOf(node.mydbConfig.connection) === -1) {
node.mydbConfig.connection.release(); // node.mydbConfig.connection.release();
} // }
}); });
} }
else { else {

View File

@ -1,6 +1,6 @@
{ {
"name": "node-red-node-mysql", "name": "node-red-node-mysql",
"version": "0.1.3", "version": "0.1.4",
"description": "A Node-RED node to read and write to a MySQL database", "description": "A Node-RED node to read and write to a MySQL database",
"dependencies": { "dependencies": {
"mysql": "^2.18.1" "mysql": "^2.18.1"