Skip to content

Instantly share code, notes, and snippets.

@tokhi
Last active April 15, 2016 09:40
Show Gist options
  • Save tokhi/c766f1f38bec95f24a6aa37acf2457ba to your computer and use it in GitHub Desktop.
Save tokhi/c766f1f38bec95f24a6aa37acf2457ba to your computer and use it in GitHub Desktop.
v = Vela::DB.new
v.src_connection(user: 'root', password: 'pass', host: '127.0.0.1', database: 'testdb', adapter: 'mysql')
v.dst_connection(user: 'user', password: 'pass', host: '127.0.0.1', database: 'testpdb', adapter: 'postgresql')
v.dbsync("src_tbl", "dst_tbl") # destination table should already been exist
# if your destination tables' columns are different than the source table (e.g; clonse `col1` data to m_col1 column):
v.dbsync("your_src_tbl", "your_dst_tbl", {"col1" => "m_col1", "col2" => "m_col2"}) # you can add as much as column as you want
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment