ascra-go-mysql
v1.0.0
Published
A modified version of go-mysql-js with updated packages
Downloads
1
Maintainers
Readme
go-mysql-js
A library wrapping the go-mysql package, providing a MySQL client connector and binlog parsing implementation.
Installation
npm i --save go-mysql-js
Example
import MysqlBinlog from 'go-mysql-js';
async function main() {
let syncer = await MysqlBinlog.create({
hostname: "localhost",
port: 3306,
username: "root",
password: "mypassword",
tableRegexes: ['Users'],
});
syncer.on('event', (event) => {
console.log('got row event', event);
});
syncer.on('error', (err) => {
console.error('got error', err);
});
process.on('SIGINT', function() {
console.log("Caught interrupt signal");
syncer.close();
});
}
main().catch(err => {
console.error(err);
process.exit(1);
});