migrate-cubrid-to-mysql

0.1.0 • Public • Published

Migrate-Cubird-To-Mysql

Migrate cubird to mysql.

How to Install

NPM

npm install migrate-cubrid-to-mysql

GIT

git clone https://github.com/iamdenny/migrate-cubird-to-mysql.git

How to use

Make tables schema on Mysql same as tables schema on Cubrid first.

app.js

var Mcm = require('migrate-cubird-to-mysql');
var htCubrid = {
    sHostname : '127.0.0.1',
    sUser : 'username',
    sPassword : 'password',
    nPort : 1527,
    sDatabase : 'database'
};
var htMysql = {
    sHostname : '127.0.0.1',
    sUser : 'username',
    sPassword : 'password',
    nPort : 3306,
    sDatabase : 'database',
    bDebug : false
};
var oMcm = new Mcm(htCubrid, htMysql);
 
oMcm.once('connected', function(){
    // first arg : oracle query
    // second arg : mysql table name
    // third arg : truncate(delete data from mysql table)
    // forth arg : callback
    oMcm.migrateByQuery("SELECT * FROM user", 'user', true, function(htResult){
          console.log('First migration is done', htResult);
      });
 
    oMcm.migrateByQuery("SELECT * FROM group", 'group', true, function(htResult){
          console.log('Second migration is done', htResult);
      });
    
    oMcm.migrateByQuery("SELECT * FROM article", 'article', true, function(htResult){
          console.log('Thrid migration is done', htResult);
      });      
}).once('done', function(htResult){
    console.log('All done', htResult);
    process.exit(0);
});

Execute

node app.js

Readme

Keywords

none

Package Sidebar

Install

npm i migrate-cubrid-to-mysql

Weekly Downloads

2

Version

0.1.0

License

BSD

Last publish

Collaborators

  • iamdenny