mysql-live-select
mysql-live-select copied to clipboard
Library still supported?
Hello, I'm trying to use mysql-live-select but I get this warning when laucnhing:
(node:27144) [DEP0096] DeprecationWarning: timers.unenroll() is deprecated. Plea
se use clearTimeout instead.
This is my code:
const LiveSelect = require('mysql-live-select');
const dbSettings = require('./config');
const liveDb = new LiveSelect(dbSettings);
liveDb.select(function(esc, escId){
return (
'select * from livetable'
);
}, [ {
table: 'livetable',
} ]).on('update', function(diff, data){
// diff contains an object describing the difference since the previous update
// data contains an array of rows of the new result set
console.log(data);
});
It successfully selects the rows when launching the server, but it doesn't see mto detect when changes occur after that.
try using mysql2
npm install mysql2 --save