-
-
Notifications
You must be signed in to change notification settings - Fork 638
Open
Labels
Description
we need some minimal instructions covering binlog setup and API documentations
binlog installation instructions:
https://github.com/nevill/zongji#installation
some usage:
node-mysql2/website/docs/examples/binlog-watcher.mdx
Lines 10 to 29 in 956c7ab
'use strict'; | |
const mysql = require('mysql2'); | |
const through2 = require('through2'); | |
const binlogStream = mysql.createBinlogStream({ | |
serverId: 123, // slave ID, first field in "show slave hosts" sql response | |
// you can also specify slave host, username, password and port | |
masterId: 0, | |
filename: 'mysql-bin.000007', | |
binlogPos: 120, | |
flags: 1, // 1 = "non-blocking mode" | |
}); | |
binlogStream.pipe( | |
through2.obj((obj, enc, next) => { | |
console.log(obj); | |
next(); | |
}) | |
); |
most of the current usage derived from zongji client, need to think how to make transition easier ( or add compatibility api )