2017 © Pedro Peláez
 

library sqltool

sql diff tool.

image

dyike/sqltool

sql diff tool.

  • Monday, September 26, 2016
  • by ityike
  • Repository
  • 1 Watchers
  • 2 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

SqlTool

Build Status, (*1)

基于PHP编写的查看线上线下数据库更新修改的状态,同时生成相应的sql语句。, (*2)

安装

使用 Composer 安装:, (*3)

composer require "dyike/sqlTool:~1.2"

使用

查看线上线下数据库的表,新增表、新增字段、修改字段的sql


use Dyike\Sqltool\Sql; use Dyike\Sqltool\JudgeSql; $tableOffLine = new Sql('hostOnLine', 'dbName', 'dbUser', 'dbPassword', 'dbPort'); $tableOnLine = new Sql('hostOFFLine', 'dbName', 'dbUser', 'dbPassword', 'dbPort'); //线上的数据表 $tOnLine = $tableOnLine->getTables(); //线下的数据表 $tOffLine = $tableOffLine->getTables(); $judgeSql = new JudgeSql(); //新增的数据 $getTablesToAdd = $judgeSql->getTableToAdd($tOnLine, $tOffLine); foreach ($getTablesToAdd as $value) { //获取新增表的创建SQL $sql = $tableOffLine->getCreateTableSql($value); print_r($sql); echo "<br>"; } foreach ($tOnLine as $value) { //获取线下表的字段 $fieldsOffLine = $tableOffLine->getFields($value); //获取线上表的字段 $fieldsOnLine = $tableOnLine->getFields($value); //新增字段的SQL $addFieldSql = $judgeSql->toAddFieldSql($fieldsOffLine, $fieldsOnLine, $value); //修改更新字段的SQL $updateFieldSql = $judgeSql->toUpdateFields($fieldsOffLine, $fieldsOnLine, $value); }

License

MIT, (*4)

The Versions

26/09 2016

dev-master

9999999-dev https://github.com/dyike/sqlTool

sql diff tool.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

mysql sqltool

26/09 2016

v1.2.0

1.2.0.0 https://github.com/dyike/sqlTool

sql diff tool.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

mysql sqltool

21/09 2016

v1.1.1

1.1.1.0 https://github.com/dyike/sqlTool

sql diff tool.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

mysql sqltool

20/09 2016

V1.1.0

1.1.0.0 https://github.com/dyike/sqlTool

sql diff tool.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

mysql sqltool

08/09 2016

v1.0.1

1.0.1.0 https://github.com/dyike/sqlTool

sql diff tool.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

mysql sqltool

08/09 2016

v1.0.0

1.0.0.0 https://github.com/dyike/sqlTool

sql diff tool.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

mysql sqltool