0.0.2 • Published 11 years ago
couchdb-to-mysql v0.0.2
converter
tiny tool to sync data between CouchDB and MySQL
why?
well, i presented CouchDB to a person and the first question was... "can you sync with MySQL?"
"Can PouchDB sync with MongoDB/MySQL/my current non-CouchDB database? No." - CouchDB FAQ.
Whith this tool... Yes.
how?
converter listen for CouchDB changes and reflects them on MySQL.
example
var converter = require('couchdb-to-mysql');
var cvr = converter();
cvr.connect();
cvr.on('created', function (change) {
// replicate changes on mysql
});methods
var converter = require('couchdb-to-mysql')var cvr = converter(config={})
Optionaly pass in a config:
config.couch.hostconfig.couch.portconfig.couch.databaseconfig.mySQL.hostconfig.mySQL.portconfig.mySQL.userconfig.mySQL.passwordconfig.mySQL.database
events
cvr.on('created', function (change) {})
Every time a document is created, a created event fires.
cvr.on('updated', function (change) {})
Every time a document is updated, a updated event fires.
cvr.on('deleted', function (change) {})
Every time a document is deleted, a deleted event fires.