Giter Site home page Giter Site logo

mysql-live-select's Introduction

mysql-live-select Build Status

NPM Package to provide events when a MySQL select statement result set changes.

Built using the zongji Binlog Tailer and node-mysql projects.

This package has been tested to work in MySQL 5.1, 5.5, 5.6, and 5.7. Expected support is all MySQL server version >= 5.1.15.

Installation

  • Add the package to your project:

    $ npm install mysql-live-select
  • Enable MySQL binlog in my.cnf, restart MySQL server after making the changes.

    # Must be unique integer from 1-2^32
    server-id        = 1
    # Row format required for ZongJi
    binlog_format    = row
    # Directory must exist. This path works for Linux. Other OS may require
    #   different path.
    log_bin          = /var/log/mysql/mysql-bin.log
    
    binlog_do_db     = employees   # Optional, limit which databases to log
    expire_logs_days = 10          # Optional, purge old logs
    max_binlog_size  = 100M        # Optional, limit log size
    
  • Create an account, then grant replication privileges:

    GRANT REPLICATION SLAVE, REPLICATION CLIENT, SELECT ON *.* TO 'user'@'localhost'

LiveMysql Constructor

The LiveMysql constructor makes 3 connections to your MySQL database:

  • Connection for executing SELECT queries (exposed node-mysql instance as db property)
  • Replication slave connection
  • information_schema connection for column information

Arguments

Argument Type Description
settings object An object defining the settings. In addition to the node-mysql connection settings, the additional settings below are available.
callback function Deprecated: callback on connection success/failure. Accepts one argument, error. See information below about events emitted.

Additional Settings

Setting Type Description
serverId integer Unique number (1 - 232) to identify this replication slave instance. Must be specified if running more than one instance.
Default: 1
minInterval integer Pass a number of milliseconds to use as the minimum between result set updates. Omit to refresh results on every update. May be changed at runtime.
checkConditionWhenQueued boolean Set to true to call the condition function of a query on every binlog row change event. By default (when undefined or false), the condition function will not be called again when a query is already queued to be refreshed. Enabling this can be useful if external caching of row changes.

Events Emitted

Use .on(...) to handle the following event types.

Event Name Arguments Description
error Error An error has occurred.
ready None The database connection is ready.

Quick Start

// Example:
var liveConnection = new LiveMysql(settings);
var table = 'players';
var id = 11;

liveConnection.select(function(esc, escId){
  return (
    'select * from ' + escId(table) +
    'where `id`=' + esc(id)
  );
}, [ {
  table: table,
  condition: function(row, newRow){
    // Only refresh the results when the row matching the specified id is
    // changed.
    return row.id === id
      // On UPDATE queries, newRow must be checked as well
      || (newRow && newRow.id === id);
  }
} ]).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);
});

See example.js for full source...

LiveMysql.prototype.select(query, triggers)

Argument Type Description
query string or function SELECT SQL statement. See note below about passing function.
triggers [object] Array of objects defining which row changes to update result set

Returns LiveMysqlSelect object

Function as query

A function may be passed as the query argument that accepts two arguments.

  • The first argument, esc is a function that escapes values in the query.
  • The second argument, escId is a function that escapes identifiers in the query.

Trigger options

Name Type Description
table string Name of table (required)
database string Name of database (optional)
Default: database setting specified on connection
condition function Evaluate row values (optional)

Condition Function

A condition function accepts up to three arguments:

Argument Name Description
row Table row data
newRow New row data (only available on UPDATE queries, null for others)
rowDeleted Extra argument for aid in external caching: true on DELETE queries, false on INSERT queries, null on UPDATE queries.

Return true when the row data meets the condition to update the result set.

LiveMysql.prototype.pause()

Temporarily skip processing of updates from the binary log.

LiveMysql.prototype.resume()

Begin processing updates after pause(). All active live select instances will be refreshed upon resume.

LiveMysql.prototype.end()

Close connections and stop checking for updates.

LiveMysql.applyDiff(data, diff)

Exposed statically on the LiveMysql object is a function for applying a diff given in an update event to an array of rows given in the data argument.

LiveMysqlSelect object

Each call to the select() method on a LiveMysql object, returns a LiveMysqlSelect object with the following methods:

Method Name Arguments Description
on, addListener event, handler Add an event handler to the result set. See the following section for a list of the available event names.
update callback Update the result set. Callback function accepts error, rows arguments. Events will be emitted.
stop None Stop receiving updates
active None Return true if ready to recieve updates, false if stop() method has been called.

As well as all of the other methods available on EventEmitter...

Available Events

Event Name Arguments Description
update diff, data First argument contains an object describing the difference since the previous update event with added, removed, moved, and copied rows. Second argument contains complete result set array.
error error Unhandled errors will be thrown

Running Tests

Tests must be run with a properly configured MySQL server. Configure test settings in test/settings/mysql.js.

Execute Nodeunit using the npm test command.

License

MIT

mysql-live-select's People

Contributors

numtel avatar wj32 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mysql-live-select's Issues

Unable to connect on Sails JS

Controller:
test : function( req, res ){

    var settings = module.exports = {
        host: 'localhost',
        user: 'root',
        password: 'root',
        database: 'leaderboard',
        port : 3307
    };

    var liveConnection = new sails.LiveSelect(settings);

    return res.send(liveConnection);

}

bootstrap.js

sails.LiveSelect = require('mysql-live-select');

'added' event does not necessarily provide actually added row

When using the numtel:meteor-mysql package within a Meteor project I encountered an interesting phenomenon:
When using an even listener on the "added" event, the index and row returned are not necessarily the actually added row, which is what I expected.

It rather seems it is the last row of the result set which is returned by the MySQL statement executed.

So let's say you have a statement "SELECT * from MYSQL_TABLE" which returns rows in an arbitrary order as determined by the MySQL engine due to the lack of an "order by" clause.

ID NAME
10 JACK
20 JOHN
30 SAM

Next you insert a new row into the MySql DB using MySql Workbench which looks like this:

ID NAME
15 CHUCK

The "SELECT * FROM MYSQL_TABLE" statement now returns:

ID NAME
10 JACK
15 CHUCK
20 JOHN
30 SAM

In this order. Yeah, not

ID NAME
10 JACK
20 JOHN
30 SAM
15 CHUCK

I was under the impression that the 'added' listener would return the value of the new row 15/CHUCK.
But instead it returns

ID NAME
30 SAM

Which also turns out to be the last row returned by SELECT * FROM MYSQL_TABLE statement when you fire it in the MySql Workbench (see above).

Question:
How can we ensure that the row returned by the 'added' event is actually the added row?

One easy workaround is to modify the table and statement like this:
"SELECT * FROM MYSQL_TABLE ORDER BY MODIFIED_DATE" where the new column "MODIFIED_DATE" defaults to NOW().
This ensures that the last row returned by the statement is always the newest one. But I believe this is not the intended behavior and it is likely that I am making a stupid mistake somewhere ...

I am a newbie to all of this so I may just overlook something very simple, in which case I would appreciate anyone helping me out on this.

Please see examples of the code below.

Server file "mysql_table.js"

Meteor.publish('mysql_table', function (limit) {
    return liveDb.select(
        'SELECT * FROM mysql_table ''),
        [{
            table: 'mysql_table'
        }]
    )
})
;

Server file "methods.js"

Meteor.methods ({
   'mysql_table.upsert': function (index, row) {
        my_mongo_collection.update(
            { myid: row.ID },
            {
               myid: row.ID,
                name: row.NAME
             },
            {upsert: true}
        );
})

Common file "myCollection.js"

my_mongo_collection = new Mongo.Collection("my_mongo_collection");

mysql_table = new MysqlSubscription('mysql_table');

mysql_table.addEventListener('error', function (error) {
    console.log('mysql_table -> error: ', error);
});

// 'added' event listener
mysql_table.addEventListener('added', function (index, row) {
    // -> index and row passed here are most likely not the actually added row 
    // if they are, then it's a coincidence!
    console.log('mysql_table -> added -> index: ', index);
    console.log('mysql_table -> added -> row: ', row); 
    Meteor.call('mysql_table.upsert', index, row); // calling upsert server side
});

Any enlightenment on this much appreciated.

  • Andrew

How does it work?

Is the MYSQL db being polled at some interval? Or does MYSQL have it's own event system that you are listening to?

using live select on large tables

We have a table with a 50 million rows, and 50 inserts/sec in production, Can I use mysql-live-select to only receive inserted items (select ... where id > lastSavePointId) without polling on such a big table?

Won't enabling binlog hurt my production environment on such a big db? any side effects? impact on server? I'm unfamiliar with it :)

Very excited when see this 👍

canSkipRowEvents setting

(Thanks for merging in my changes last week! We've been running version 0.0.24 successfully since then and performance has improved drastically.)

In commit a44c86b the canSkipRowEvents setting seems to have been removed. Could you add it back?

Some background: It's my fault for not documenting this setting properly, but basically we rely on this setting being false so that matchRowEvent always calls our condition function for every single row event, rather than skipping events when the query cache's updateTimeout is null. We need this behavior because we have many large JOIN-based queries and we wrote condition functions that cache certain keys to filter out irrelevant row events. I added the canSkipRowEvents setting because most people don't need this behavior, and the updateTimeout === null check could improve performance if matchRowEvent is expensive.

Clarification about architecture, etc

Hi, this sounds like an interesting project...

I'm wondering a few things, maybe you can help...

  • is this production ready? (I see its under development still, but any use in production?)
  • what is the topoloy exactly? does this go together with a mysql server? how would one scale this? or is it just a "connector" on a mysql master, and then this can be served out?

Thanks!

Question: Meteor mysql-live-select as a backend for React-Native

Sorry to add this as an issue but cannot find an answer anywhere.

I am trying to understand how to pass Mysql data from meteor to react-native using mysql-live-select. I can connect using the MysqlSubscription from numtel:mysql but still cannot figure out how to do it using the npm package.

  • Can you please create a full server-client example?
  • How can I export the received diff data to a react-native client using react-native-meteor?

This is my code so far in meteor server:

import {Meteor} from "meteor/meteor";
import LiveMysql from "mysql-live-select";

Meteor.startup(() => {
    var settings = {
        host: 'localhost',
        user: 'user',
        password: 'pass',
        database: 'test',
        serverId: 1,
        minInterval: 200
    };

    const liveDb = new LiveMysql(settings);

    var closeAndExit = function () {
        liveDb.end();
        process.exit();
    };

    process.on('SIGTERM', closeAndExit);
    process.on('SIGINT', closeAndExit);

    const table = 'jp9sa_k2_items';

    Meteor.publish('news', () => {
        return liveDb.select(
            "SELECT * FROM " +
            "( " +
            "SELECT jp9sa_k2_items.id, " +
            "jp9sa_k2_categories.`name` AS category, " +
            "jp9sa_k2_categories.id AS catid, " +
            "jp9sa_k2_items.alias, " +
            "jp9sa_k2_items.title, " +
            "jp9sa_k2_items.hits AS hits, " +
            "jp9sa_k2_items.introtext AS text, " +
            "jp9sa_k2_items.fulltext AS ftext, " +
            "CONVERT_TZ(jp9sa_k2_items.publish_up,'+00:00','+03:00') AS date " +
            "FROM jp9sa_k2_categories INNER JOIN jp9sa_k2_items " +
            "ON jp9sa_k2_categories.id = jp9sa_k2_items.catid " +
            "WHERE jp9sa_k2_items.published = 1 " +
            "AND CONVERT_TZ(jp9sa_k2_items.publish_up,'+00:00','+03:00') <= NOW() " +
            "AND jp9sa_k2_items.trash = 0 " +
            "ORDER BY date DESC " +
            "LIMIT 0, 20" +
            ") AS T1 " +
            "ORDER BY date ASC",
            [{table: table}]
        ).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(diff);
        })
    })
});

Many Thanks

Result sets no longer update

node -v: 4.4.7
mysql-live-select: 1.1.9

Result sets do not update to console. Here is code to reproduce:

var LiveMysql = require('mysql-live-select');

var settings = {
  host        : 'localhost',
  user        : 'xxxxx',
  password    : 'xxxxx',
  database    : 'shoreware',
  minInterval : 200,
  port        : 4308
};

var liveConnection = new LiveMysql(settings);

liveConnection.select(function(){
  return (
    'SELECT u.UserDN, u.GuiLoginName, u.LDAPGuid, u.LDAPDomainName, s.FirstName, t.EmailAddress, u.LastUpdateUTCTime, s.LastName, s.WorkPhone, s.CellPhone, s.FaxPhone, s.SiteName, d.Digits, CONCAT(SUBSTR(BasePhoneNumber,3,10 - CHAR_LENGTH(d.Digits)),d.Digits) AS DID FROM shoreware.users AS u JOIN shoreware.diddigitmap AS d ON u.UserDN = d.DN JOIN systemdirectorydisplay AS s ON u.UserDN = s.dn JOIN tabaddresses AS t ON u.AddressID = t.AddressID WHERE description IS NULL'
  );
}, [ {
  condition: function(row, newRow){
    // Only refresh the results when the row matching the specified id is
    // changed.
    return row.id === id
      // On UPDATE queries, newRow must be checked as well
      || (newRow && newRow.id === id);
  }
} ]).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(diff);
});

'Error: Cannot enqueue Query after being destroyed' when calling liveDB.end

I got this code to test a connection:

        var liveDB = new LiveMysql(
        {
            host: host,
            post: port,
            user: user,
            password: password
        }, function(err, result) {
            liveDB.end();
        });

And I keep getting this error: 'Error: Cannot enqueue Query after being destroyed' at Protocol._validateEnqueue (C:\Users\Tommy J\AppData\Local.meteor\packages\nu
mtel_mysql\0.1.9\npm\node_modules\mysql-live-select\node_modules\zongji\node_modules\mysql\lib\protocol\Protocol.js:199:
16)

How can I end a connection properly?

Issues on localhost

=> Meteor server restarted
W20150904-14:24:09.988(5.5)? (STDERR)
W20150904-14:24:09.988(5.5)? (STDERR) /Users/rishabh/.meteor/packages/numtel_mysql/.1.0.2.lqfdsj++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/node_modules/zongji/node_modules/mysql/lib/protocol/Parser.js:82
W20150904-14:24:09.989(5.5)? (STDERR) throw err;
W20150904-14:24:09.989(5.5)? (STDERR) ^
W20150904-14:24:09.989(5.5)? (STDERR) Error: ER_MASTER_FATAL_ERROR_READING_BINLOG: Could not open log file
W20150904-14:24:09.989(5.5)? (STDERR) at Binlog.Sequence._packetToError (/Users/rishabh/.meteor/packages/numtel_mysql/.1.0.2.lqfdsj++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/node_modules/zongji/node_modules/mysql/lib/protocol/sequences/Sequence.js:48:14)
W20150904-14:24:09.989(5.5)? (STDERR) at Binlog.Sequence.ErrorPacket (/Users/rishabh/.meteor/packages/numtel_mysql/.1.0.2.lqfdsj++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/node_modules/zongji/node_modules/mysql/lib/protocol/sequences/Sequence.js:109:17)
W20150904-14:24:09.989(5.5)? (STDERR) at Protocol._parsePacket (/Users/rishabh/.meteor/packages/numtel_mysql/.1.0.2.lqfdsj++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/node_modules/zongji/node_modules/mysql/lib/protocol/Protocol.js:271:23)
W20150904-14:24:09.989(5.5)? (STDERR) at Parser.write (/Users/rishabh/.meteor/packages/numtel_mysql/.1.0.2.lqfdsj++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/node_modules/zongji/node_modules/mysql/lib/protocol/Parser.js:77:12)
W20150904-14:24:09.990(5.5)? (STDERR) at Protocol.write (/Users/rishabh/.meteor/packages/numtel_mysql/.1.0.2.lqfdsj++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/node_modules/zongji/node_modules/mysql/lib/protocol/Protocol.js:39:16)
W20150904-14:24:09.990(5.5)? (STDERR) at Socket. (/Users/rishabh/.meteor/packages/numtel_mysql/.1.0.2.lqfdsj++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/node_modules/zongji/node_modules/mysql/lib/Connection.js:82:28)
W20150904-14:24:09.990(5.5)? (STDERR) at Socket.emit (events.js:95:17)
W20150904-14:24:09.990(5.5)? (STDERR) at Socket. (stream_readable.js:765:14)
W20150904-14:24:09.990(5.5)? (STDERR) at Socket.emit (events.js:92:17)
W20150904-14:24:09.990(5.5)? (STDERR) at emitReadable
(_stream_readable.js:427:10)
W20150904-14:24:09.990(5.5)? (STDERR) --------------------
W20150904-14:24:09.990(5.5)? (STDERR) at Protocol._enqueue (/Users/rishabh/.meteor/packages/numtel_mysql/.1.0.2.lqfdsj++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/node_modules/zongji/node_modules/mysql/lib/protocol/Protocol.js:135:48)
W20150904-14:24:09.990(5.5)? (STDERR) at Object._start as _onImmediate
W20150904-14:24:09.990(5.5)? (STDERR) at processImmediate as _immediateCallback
=> Exited with code: 8

Concurrent User Benchmarking

Hello, we are using this package in a Meteor app. The queries to the database work well and are reactive correctly, however we are finding our app bottlenecks after 60-70 or so concurrent users.

In trying to pinpoint the bottleneck and a cause, we would like to run some benchmarking on the mysql connection and the binlog. I see in the readme there is a unit test, but does anyone have a way to benchmark? Or a simple script to test concurrent connections?

No reactivity with views

Hi,

I have created view in mysql database. When I change something in tables, it updates the view but reactivity with view is not working. I can't see new data populated in UI when view updates. Reactivity works with tables perfectly if I connect UI with tables but not with views.

Is there any way to set it up?

Regards,
Nitin

Connection Timeout

I'm using the sails js live package. After about 15 minutes, the end function is called. But it doesn't reconnect unless the URL is reloaded.

screen shot 2015-11-23 at 3 42 47 pm

Can't use /var/log/mysql/mysql-bin.log as bin log location on a Mac

I think this is the case at least (kept having issues with permissions) and based on your example for setting up binlog it's not clear if we can use an alternative location for the log or not? I keep having issues and I'm not sure if this is the cause or what, but I think a simple comment on that line could help people like me in the future

[question] If self.emit.apply(self, arguments) return false, what does it mean?

Dear @numtel
I am debugging my meteorient project which is modifying mysql-live-select. I invert two console.logs in codes.

var abc = self.emit('update', records);
  console.log(abc);
var diffEvent = function(){
      var abc = self.emit.apply(self, arguments);
      console.log(abc);
      diff.push(Array.prototype.slice.call(arguments));
    }

the first one returns true, so I think emitter works. When the second one was called, it returns false every time. So I think that is why I can't find data on client side-- event emited false.

How to check reasons further? I am going to check subscription.

Thank you very much.

How to use this library with node cluster?

Hi. I have typical node cluster.

var cluster = require('cluster');
var numCPUs = require('os').cpus().length;

if (cluster.isMaster) {
  for (var i = 0; i < numCPUs; i++) {
    cluster.fork();
  }

  cluster.on('exit', (worker, code, signal) => {
    console.log('worker ' + worker.process.pid + ' died');
  });
} else {
  require('./worker.js');
}

Now I want to use mysql-live-select within worker.js but I want to it was connected to mysql only once and this connection could be shared between workers.

Right now I am wrote this within worker.js

//worker.js
var LiveMysql = require('mysql-live-select');
var settings = {
  host        : 'localhost',
  user        : 'root',
  password    : '',
  database    : 'fc',
  //serverId    : 1,
  minInterval : 200
};
var liveMysql = new LiveMysql(settings);

but this does not work and I get an error: Error: ER_CON_COUNT_ERROR: Too many connections

How to fix? Thanks.

Connection error handling

Looking at this new interface. One very good point that was missing from your earlier version, as below.

Please bring back the connection error handling. In the new code db.connect() is inside LiveMySql() and does not have much chance for graceful error handling or logging.

For example, please make the LiveMySql accept optional error handling callback, (just like your earlier mysql.createConnection.connect used to have). That was it would be something like

var liveDb = new LiveMysql(Meteor.settings.mysql, function (err) {
    if (err)
        console.error("Error connecting to db:");
    else
        console.log("Connected to DB");
});

Error = Protocol._validateEnqueue (However log_bin is definitely ON)

Hi

If I run the SQL command:
SHOW VARIABLES LIKE 'log_bin';
Result is
log_bin = ON

But I get the following error message:
=> Started proxy.
=> Started MongoDB.
=> Started your app.
=> App running at: http://localhost:4000/

I20150322-14:18:05.092(10.5)? Exception from sub allPlayers id 3RGt6tzuECcPLizrQ Error: Cannot enqueue Query after fatal error.
I20150322-14:18:05.092(10.5)? at Protocol._validateEnqueue (/Users/RobGordon/.meteor/packages/numtel_mysql/.0.1.4.nergik++os+web.browser+web.cordova/npm/node_modules/mysql/lib/protocol/Protocol.js:193:16)
I20150322-14:18:05.092(10.5)? at Protocol._enqueue (/Users/RobGordon/.meteor/packages/numtel_mysql/.0.1.4.nergik++os+web.browser+web.cordova/npm/node_modules/mysql/lib/protocol/Protocol.js:129:13)
I20150322-14:18:05.092(10.5)? at Connection.query (/Users/RobGordon/.meteor/packages/numtel_mysql/.0.1.4.nergik++os+web.browser+web.cordova/npm/node_modules/mysql/lib/Connection.js:185:25)
I20150322-14:18:05.093(10.5)? at _update (/Users/RobGordon/.meteor/packages/numtel_mysql/.0.1.4.nergik++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/lib/LiveMysqlSelect.js:111:18)
I20150322-14:18:05.093(10.5)? at LiveMysqlSelect.update (/Users/RobGordon/.meteor/packages/numtel_mysql/.0.1.4.nergik++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/lib/LiveMysqlSelect.js:124:5)
I20150322-14:18:05.093(10.5)? at new LiveMysqlSelect (/Users/RobGordon/.meteor/packages/numtel_mysql/.0.1.4.nergik++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/lib/LiveMysqlSelect.js:27:10)
I20150322-14:18:05.093(10.5)? at LiveMysql.select (/Users/RobGordon/.meteor/packages/numtel_mysql/.0.1.4.nergik++os+web.browser+web.cordova/npm/node_modules/mysql-live-select/lib/LiveMysql.js:90:19)
I20150322-14:18:05.093(10.5)? at [object Object].handler (app/leaderboard.js:93:19)
I20150322-14:18:05.093(10.5)? at maybeAuditArgumentChecks (packages/ddp/livedata_server.js:1617:1)
I20150322-14:18:05.093(10.5)? at [object Object].
.extend._runHandler (packages/ddp/livedata_server.js:950:1)

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);
});

Bin Log on RDS with MySQL 5.6

@numtel
What's the procedure to enable binlog on MySQL 5.6 + running on a RDS. There's no my.cnf file on RDS.

Basically my bin log files are located at
Uploading Screen Shot 2015-09-04 at 3.11.15 pm.png…

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.