MySQL Binlog Node: Golang-Driven Database Insight

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);
});

Download Details:

Author: StefanPluto
Source Code: https://github.com/StefanPluto/mysql-binlog-node 
License: MIT

#go #golang #mysql #node 

MySQL Binlog Node: Golang-Driven Database Insight
1.60 GEEK