mirror of
https://github.com/node-red/node-red-nodes.git
synced 2023-10-10 13:36:58 +02:00
undo mysql change again
This commit is contained in:
parent
3330053a1c
commit
fabd3753b4
@ -128,7 +128,7 @@ module.exports = function(RED) {
|
||||
var bind = [];
|
||||
if (Array.isArray(msg.payload)) { bind = msg.payload; }
|
||||
else if (typeof msg.payload === 'object' && msg.payload !== null) {
|
||||
bind=msg.payload;
|
||||
bind = msg.payload;
|
||||
node.mydbConfig.connection.config.queryFormat = function(query, values) {
|
||||
if (!values) {
|
||||
return query;
|
||||
@ -148,7 +148,7 @@ module.exports = function(RED) {
|
||||
node.error(err,msg);
|
||||
}
|
||||
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));
|
||||
}
|
||||
else { msg.payload = rows; }
|
||||
@ -156,9 +156,9 @@ module.exports = function(RED) {
|
||||
status = {fill:"green",shape:"dot",text:"OK"};
|
||||
node.status(status);
|
||||
}
|
||||
if (node.mydbConfig.pool._freeConnections.indexOf(node.mydbConfig.connection) === -1) {
|
||||
node.mydbConfig.connection.release();
|
||||
}
|
||||
// if (node.mydbConfig.pool._freeConnections.indexOf(node.mydbConfig.connection) === -1) {
|
||||
// node.mydbConfig.connection.release();
|
||||
// }
|
||||
});
|
||||
}
|
||||
else {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"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",
|
||||
"dependencies": {
|
||||
"mysql": "^2.18.1"
|
||||
|
Loading…
x
Reference in New Issue
Block a user