Search
 
SCRIPT & CODE EXAMPLE
 

SQL

make a socket server to detect changes in mysql

var MySQLEvents = require('mysql-events');
var dsn = {
  host:     _dbhostname_,
  user:     _dbusername_,
  password: _dbpassword_,
};
var mysqlEventWatcher = MySQLEvents(dsn);
var watcher =mysqlEventWatcher.add(
  'myDB.table.field.value',
  function (oldRow, newRow, event) {
     //row inserted 
    if (oldRow === null) {
      //insert code goes here 
    }

     //row deleted 
    if (newRow === null) {
      //delete code goes here 
    }

     //row updated 
    if (oldRow !== null && newRow !== null) {
      //update code goes here 
    }

    //detailed event information 
    //console.log(event) 
  }, 
  'match this string or regex'
);
Comment

PREVIOUS NEXT
Code Example
Sql :: salesforce soql get parents without children 
Sql :: how to count codition 
Sql :: how to check rollback status in oracle 
Sql :: oracle privileges 
Sql :: query builder doctrien return sql 
Sql :: rasa mysql connection custom actions example 
Sql :: modularity meaning in plsql 
Sql :: how to create a table in sql stack overflow 
Sql :: How to make PHP handeling my "WITH CTE as" SQL 
Sql :: sql mod even odd 
Sql :: alter domain sql 
Sql :: oracle execute immediate quotes 
Sql :: python sqlalcahmey compare datetime 
Sql :: sql run online 
Sql :: sql database column values restrict 
Sql :: product of a column in mysql 
Sql :: sql agent jb is enabled query 
Sql :: SELECT MAX(age) FROM Customers; 
Sql :: query to fetch 50% records from the table. 
Sql :: sql get highest date from 3 tabels 
Sql :: snowflake last query id 
Sql :: SQL TABLE : SUBSCRIPTION, PRODUCT, SPECIFICATION 
Sql :: data table footer customize 
Sql :: tsql select everything before a character 
Sql :: change authentication plugin from auth_sock to mysql_native_password for a specific user 
Sql :: how to add session data into mysql database from button 
Sql :: mysql query problems and solutions 
Sql :: many to many getting data mysql 
Sql :: tsql create table with variable name 
Sql :: truncate syntax in sql 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =