MySQL live select package that emits events when the result set of a SELECT statement changes. Built on top of zongji (binlog tailer) and node-mysql. Current stable version 1.0.6. Supports MySQL 5.1 to 5.7. Requires binlog enabled. Provides a LiveMysql constructor that makes three connections: for queries, replication, and information_schema. Releases are infrequent. Differentiator: enables real-time reactive UI updates from MySQL without polling.
npm install mysql-live-selectNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a LiveMysql instance, waits for ready event, then registers a live SELECT query on the 'players' table with a condition to only fire when the row with id=11 changes.
Enable binlog in my.cnf: server-id=1, binlog_format=row, log_bin=/path/to/log, and grant REPLICATION SLAVE, REPLICATION CLIENT, SELECT privileges.
Remove callback argument and use .on('ready', ...) to handle connection success.Check max_connections and user connection limits. Use a dedicated user with sufficient connections.
Wrap your query in a function with (esc, escId) parameters to properly escape values and identifiers.
Ensure each condition object has a 'table' string and a 'condition' function.
Set checkConditionWhenQueued: true if you need condition re-evaluation on every binlog event.
Grant REPLICATION SLAVE, REPLICATION CLIENT, SELECT ON *.* TO 'user'@'localhost' and FLUSH PRIVILEGES.
Enable binlog in my.cnf: server-id=1, binlog_format=row, log_bin=/path/to/log, then restart MySQL.
Instantiate with new: const liveConnection = new LiveMysql(settings); then call liveConnection.select(...).
Start MySQL server, check host and port settings, and ensure firewall allows connection.