项目作者: camry

项目描述 :
Golang 针对 MySQL 数据库表结构的差异 SQL 工具。
高级语言: Go
项目地址: git://github.com/camry/go-mysqldiff.git
创建时间: 2020-09-19T04:45:27Z
项目社区:https://github.com/camry/go-mysqldiff

开源协议:MIT License

下载


mysqldiff

Golang 针对 MySQL 数据库表结构的差异 SQL 工具。

比对选项

  • 比对表
    • 比对主键
    • 比对外键(默认关闭,需要加 —foreign 参数)
    • 比对索引
    • 比对触发器
    • 比对字符集
    • 比对自动递增值
    • 比对分区
    • 比对表选项
    • 比对注释(默认关闭,需要加 —comment 参数)
  • 比对视图
  • 比对函数
  • 比对事件
  • 比对定义者

使用

  1. # 查看帮助
  2. ./mysqldiff --help
  3. # 实例
  4. ./mysqldiff --source user:password@host:port --db db1:db2
  5. ./mysqldiff --source user:password@host:port --target user:password@host:port --db db1:db2
  6. ./mysqldiff --source user:password@host:port --target user:password@host:port --db db1:db2 --comment

自动补全

  1. mysqldiff completion bash > /etc/bash_completion.d/mysqldiff && source /etc/bash_completion.d/mysqldiff

打包

包含命令自动补全

  1. ./install.bash