Skip to content
This repository has been archived by the owner on Apr 29, 2020. It is now read-only.
/ mysql-onchange Public archive

A nodejs module that check mysql table for changes by checking rows

License

Notifications You must be signed in to change notification settings

nainemom/mysql-onchange

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nai-mysql-onchange

A nodejs module that check mysql table for changes by checking rows

Install

npm install https://github.com/nainemom/nai-mysql-onchange.git
// existing connection
var nmo	= require("nai-mysql-onchange").init({
	connection: db
});
// or new one
var nmo	= require("nai-mysql-onchange").init({
	host: "localhost",
	user: "root",
	password: "",
	database: "mydb"
});

Watching table

nmo.watch({
	table: "devices",
	uniqueField: "id",
	interval: 5000
}).onUpdate( function(row, oldRow){
	// hooray! oldRow was changed to row!
}).onInsert( function(row){
	// yeahh! the row was inserted!
}).onDelete( function(row){
	// nooo! row was deleted. :(
});

About

A nodejs module that check mysql table for changes by checking rows

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published