ascra-go-mysql
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

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

Package Sidebar

Install

npm i ascra-go-mysql

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

82.1 MB

Total Files

11

Last publish

Collaborators

  • stefanpluto