lmmt MySQL 迁移工具开源项目

我要开发同款
匿名用户2019年12月11日
94阅读

技术信息

开源地址
https://gitee.com/consolelog/lightweight-mysql-migrate-tools
授权协议
MIT

作品详情

这是一个MySQL迁移工具。

支持模块TableViewFuctioProcedureTrigger使用方法

引入jar包:

<depedecy><groupId>c.codeforfu</groupId><artifactId>mysql-migrate</artifactId><versio>1.0.0</versio></depedecy>

测试方法:

importc.codeforfu.migrate.core.diff.DiffResult;importc.codeforfu.migrate.core.etity.DatabaseIfo;importorg.juit.Test;importjava.sql.SQLExceptio;importjava.util.List;privatestaticfialItegerFROM_PORT=3306;privatestaticfialStrigFROM_HOST="localhost";privatestaticfialStrigFROM_USERNAME="root";privatestaticfialStrigFROM_PASSWORD="root";privatestaticfialStrigFROM_TABLE="test_db";privatestaticfialItegerTO_PORT=3307;privatestaticfialStrigTO_HOST="localhost";privatestaticfialStrigTO_USERNAME="root";privatestaticfialStrigTO_PASSWORD="root";privatestaticfialStrigTO_TABLE="test_db";@Testpublicvoiddiff()throwsSQLExceptio{DatabaseIfofrom=ewDatabaseIfo(FROM_HOST,FROM_PORT,FROM_TABLE,FROM_USERNAME,FROM_PASSWORD);DatabaseIfoto=ewDatabaseIfo(TO_HOST,TO_PORT,TO_TABLE,TO_USERNAME,TO_PASSWORD);Migratemigrate=ewMigrate().from(from).to(to);DiffResultdiffResult=migrate.diff();List<Strig>sqlList=diffResult.getSqlList();for(Strigsql:sqlList){System.out.pritl(sql);}}@Testpublicvoidupdate()throwsSQLExceptio{DatabaseIfofrom=ewDatabaseIfo(FROM_HOST,FROM_PORT,FROM_TABLE,FROM_USERNAME,FROM_PASSWORD);DatabaseIfoto=ewDatabaseIfo(TO_HOST,TO_PORT,TO_TABLE,TO_USERNAME,TO_PASSWORD);Migratemigrate=ewMigrate().from(from).to(to);migrate.update();}源码地址

Gitee仓库

Github仓库

功能介绍

这是一个MySQL迁移工具。 支持模块 Table View Function Procedure Trigger 使用方法 引入jar包:
<dependency>
<groupId...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论