Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-red-node-mysql

Package Overview
Dependencies
Maintainers
2
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-red-node-mysql - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

locales/en-US/68-mysql.html

24

68-mysql.js

@@ -22,5 +22,4 @@

function checkVer() {
node.connection.query("SELECT version();", [], function(err, rows) {
node.pool.query("SELECT version();", [], function(err, rows, fields) {
if (err) {
node.connection.release();
node.error(err);

@@ -88,9 +87,9 @@ node.status({fill:"red",shape:"ring",text:"Bad Ping"});

this.on('close', function (done) {
this.on('close', function(done) {
if (this.tick) { clearTimeout(this.tick); }
if (this.check) { clearInterval(this.check); }
node.connected = false;
node.connection.release();
// node.connection.release();
node.emit("state"," ");
node.pool.end(function (err) { done(); });
node.pool.end(function(err) { done(); });
});

@@ -135,7 +134,7 @@ }

bind=msg.payload;
node.mydbConfig.connection.config.queryFormat = function (query, values) {
if (!values){
node.mydbConfig.connection.config.queryFormat = function(query, values) {
if (!values) {
return query;
}
return query.replace(/\:(\w+)/g, function (txt, key) {
return query.replace(/\:(\w+)/g, function(txt, key) {
if (values.hasOwnProperty(key)) {

@@ -146,5 +145,5 @@ return this.escape(values[key]);

}.bind(this));
};
};
}
node.mydbConfig.connection.query(msg.topic, bind, function(err, rows) {
node.mydbConfig.pool.query(msg.topic, bind, function(err, rows) {
if (err) {

@@ -156,3 +155,3 @@ status = {fill:"red",shape:"ring",text:"Error: "+err.code};

else {
if (rows.constructor.name === "OkPacket") {
if ( (rows.constructor.name === "OkPacket") || (rows.constructor.name === "Array")) {
msg.payload = JSON.parse(JSON.stringify(rows));

@@ -165,2 +164,3 @@ }

}
//node.mydbConfig.connection.release();
});

@@ -183,3 +183,3 @@ }

node.on('close', function () {
node.on('close', function() {
if (node.tout) { clearTimeout(node.tout); }

@@ -186,0 +186,0 @@ node.mydbConfig.removeAllListeners();

{
"name": "node-red-node-mysql",
"version": "0.1.1",
"version": "0.1.2",
"description": "A Node-RED node to read and write to a MySQL database",

@@ -5,0 +5,0 @@ "dependencies": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc