zongji, wrap for result
Base onInstallation
-
Requires Node.js v4+
$ npm install zongji2
Quick Start
const Listener = ; const binlog = host: 'localhost' // MySQL Connection Settings user: 'user' password: 'password'; binlog; binlogstart serverId: 1 startAtEnd: true includeEvents: 'rotate' 'tablemap' 'writerows' 'updaterows' 'deleterows' includeSchema: 'database': 'table_1' 'table_2' ;
the result like below:
You can retry through binlogName and binlogNextPos if something error.
{
binlogName: 'mysql-bin.000004',
binlogNextPos: 5670,
action: 'WriteRows',
database: 'database',
table: 'table_1',
rows:[
{ id: 1, username: 'name', sex: 'm' }
]
}
For a complete implementation see zongji ...