Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zyimm/sync-data-struct
sync-data-struct是一个用来比较两个数据库之间的数据结构差异,并生成更新DDL的工具包.方便对比出两个数据库之间差异来进行数据结构同步.
https://github.com/zyimm/sync-data-struct
mysql mysql-database
Last synced: about 1 month ago
JSON representation
sync-data-struct是一个用来比较两个数据库之间的数据结构差异,并生成更新DDL的工具包.方便对比出两个数据库之间差异来进行数据结构同步.
- Host: GitHub
- URL: https://github.com/zyimm/sync-data-struct
- Owner: zyimm
- License: gpl-3.0
- Created: 2020-07-29T08:20:53.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-06T02:34:24.000Z (about 1 year ago)
- Last Synced: 2024-09-28T15:42:20.910Z (about 2 months ago)
- Topics: mysql, mysql-database
- Language: PHP
- Homepage: http://composer.zyimm.com
- Size: 60.5 KB
- Stars: 4
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## sync-data-struct
sync-data-struct是一个用来比较两个数据库之间的数据结构差异,并生成更新DDL的工具包,不依赖于任何三方库.方便对比出两个数据库之间差异来进行数据结构同步.|
sync-data-struct is a toolkit for comparing data structure differences between two databases and generating updated DDL. Easy to compare the difference between the two databases for data structure synchronization## support database && 支持的数据库
- mysql## install && 安装
```
composer require zyimm/sync-data-struct
```
## example && 示例
```
//set error
error_reporting(E_ALL);
ini_set('display_errors', true);
//autoload
include '../vendor/autoload.php';
//db
$config = [
//本地数据库
'local' => [
'host' => 'mysql',
'username' => 'root',
'passwd' => '123456',
'dbname' => 'local'
],
//开发数据库或目标同步数据
'dev' => [
'host' => 'mysql',
'username' => 'root',
'passwd' => '123456',
'dbname' => 'dev'
]
];
$handle = new \Zyimm\dbStructSync\Sync($config);
echo $handle->toHtml();
```## issue
能力有限!欢迎提出issue,共同学习进步。