mirror of
https://github.com/node-red/node-red-nodes.git
synced 2025-03-01 10:37:43 +00:00
undo mysql change again
This commit is contained in:
parent
3330053a1c
commit
fabd3753b4
@ -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 {
|
||||||
|
@ -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"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user