Stream multiple MySQL tables easily using mysql API
npm install -g mysql-stream
var mystream = require( "mystream" );
//open connection with options
var streamer = new Streamer('user:{password}@host{:port}/database', options);
// return a readable stream
var readableStream = streamer.asReadable(['table1','table2'], done);
// example usage #1
readableStream
.on("data", function (data) {
console.log(data);
});
// example usage #2
readableStream.pipe(process.stdout);
url
a MySQL connection url stringconfig
containshighWaterMark
for now, which determines the amount of data potentially buffered. default is 16.- Returns an object with a Streamer
Creates a mysql connection. Uses the mysql.createConnection arguments.
tableNames
represents table names to include in the stream. could be either a string or an array- Returns an ReadableStream
Opens a MySQL connection. Uses the mysql.stream function, and transforms it using ObjectMode.