GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - AllinProgram/compare-database-differences: 本项目可以帮助快速比较两个数据库差异,尤其适合对比同一项目不同环境之间的表、字段差异,帮助快速发现差异,避免不同环境部署代码时数据库结构的不兼容。

BranchesTags
Open more actions menu

Latest commit

 

History

21 Commits
21 Commits

Folders and files

NameName
Last commit message
Last commit date
asserts
asserts
 
 
src
src
 
 
README.adoc
README.adoc
 
 
pom.xml
pom.xml
 
 

Repository files navigation

compare-database-differences

本项目可以帮助快速比较两个不同数据库的表字段差异,尤其适合同一项目不同环境之间的对比,帮助快速发现差异,避免不同环境部署代码时数据库结构的不兼容。

目录
  • 特性
  • 怎么使用
    • 场景1:本地能够连接数据库
    • 场景2:本地无法直连数据库,或者仅有一个库可以直连
  • 执行示例

特性

  • ✓ 支持MySQL(MySQL8需要更新驱动依赖,后续会动态处理)

  • ✓ 支持OceanBase以及分库分表场景

  • ✓ 发现环境特有的表

  • ✓ 发现表特有的字段

  • ✓ 发现字段数据类型不一致的情况

  • ✓ 发现字段数据限制不一致的情况

  • ✓ 支持将差异数据生成文件方便查看

  • ❏ 发现表索引差异

  • ❏ 发现表规格差异

  • ❏ 支持给出修复差异的策略

  • ❏ 支持GUI客户端使用

  • ❏ 支持IDEA插件使用

怎么使用

场景1:本地能够连接数据库

public class Main {
    public static void main(String[] args) {
        new DBCompareStart(
                new DBCompareStart.DBConfig(
                        "A环境",
                        "jdbc:mysql://hostA:portA/databaseA",
                        "username",
                        "password"),
                new DBCompareStart.DBConfig(
                        "B环境",
                        "jdbc:mysql://hostB:portB/databaseB",
                        "username",
                        "password")
        );
    }
}

场景2:本地无法直连数据库,或者仅有一个库可以直连

public class Main {
    public static void main(String[] args) {
        new DBCompareStart(
                new DBCompareStart.DBConfig(
                        "A环境",
                        "src/main/resources/a-create-table.sql"),
                new DBCompareStart.DBConfig(
                        "B环境",
                        "jdbc:mysql://hostB:portB/databaseB",
                        "username",
                        "password")
        );
    }
}

执行示例

preview diff data

About

本项目可以帮助快速比较两个数据库差异,尤其适合对比同一项目不同环境之间的表、字段差异,帮助快速发现差异,避免不同环境部署代码时数据库结构的不兼容。

Resources

Readme
Activity

Stars

4 stars

Watchers

1 watching

Forks

0 forks
Report repository

Used by

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.