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

mysql-live-select

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-live-select - npm Package Compare versions

Comparing version 0.0.19 to 0.0.20

7

lib/LiveMysqlSelect.js

@@ -21,2 +21,3 @@ /* mysql-live-select, MIT License ben@latenightsketches.com

self.data = [];
self.initialized = false;

@@ -121,4 +122,10 @@ if(self.query in base._resultsBuffer){

}
}else if(self.initialized === false){
// If the result set initializes to 0 rows, it still needs to output an
// update event.
self.emit('update', rows);
}
self.initialized = true;
self.lastUpdate = Date.now();

@@ -125,0 +132,0 @@ };

2

package.json
{
"name": "mysql-live-select",
"version": "0.0.19",
"version": "0.0.20",
"description": "Live updating MySQL SELECT statements",

@@ -5,0 +5,0 @@ "main": "lib/LiveMysql.js",

@@ -143,2 +143,31 @@ /* mysql-live-select, MIT License ben@latenightsketches.com

},
emptyResults: function(test){
var waitTime = 500;
var table = 'empty_results';
server.on('ready', function(conn, esc, escId, queries){
querySequence(conn.db, [
'DROP TABLE IF EXISTS ' + escId(table),
'CREATE TABLE ' + escId(table) + ' (col INT UNSIGNED)',
], function(results){
var pauseTime = Date.now();
conn.select('SELECT * FROM ' + escId(table), [ {
table: table,
database: server.database
} ]).on('update', function(rows){
if(rows.length === 0) {
// Initialized with no rows, so add one
querySequence(conn.db, [
'INSERT INTO ' + escId(table) + ' (col) VALUES (10)'
], function(results){
// ...
});
}else if(rows.length > 0 && rows[0].col === 10){
// Row was added, all done
test.done();
}
});
});
});
},
pauseAndResume: function(test){

@@ -145,0 +174,0 @@ var waitTime = 500;

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