bogdananton/mysql-to-object-mapper 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

bogdananton/mysql-to-object-mapper

最新稳定版本:1.0.2

Composer 安装命令:

composer require bogdananton/mysql-to-object-mapper

包简介

MySQL-to-object-mapper outputs PHP objects from SQL dumps or servers

README 文档

README

Build Status Code Climate Coverage Status

Scans MySQL structure and converts it into PHP objects. Using MySQL file dumps or a server as input.

Download the phar file from the latest release page.

Commands:

MySQL Extractor version 1.0.0

Usage:
  command [options] [arguments]

Available commands:
 snapshot
  snapshot:compare  Compares two snapshots and outputs the differences.
  snapshot:create   Scans a DB and outputs the structure.
 sync
  sync:compare      Compare two server DB instances and outputs their differences.

Snapshot create command:

Usage:
  snapshot:create <source> <output>

Arguments:
  source  DB instance to be analysed. Format: USER:PASS@HOSTNAME[:PORT]/DATABASE or /PATH/TO/SQL/DUMPS/
  output  Output folder for the results file(s), where the database structure will be dumped in JSON format. Data will be stored in [databaseName]-[date]-[timestamp].json format.


Help:
 Scans a DB and outputs the structure.

Sample output:

{
    "Name": "redmine",
    "Tables": [
        {
            "Name": "attachments",
            "Fields": [
                {
                    "Id": "id",
                    "Type": "INT",
                    "Length": 11,
                    "Null": false,
                    "Default": 0,
                    "Comment": null,
                    "Autoincrement": true,
                    "Values": []
                },
                {
                    ...
                }
            ],
            "Keys": [
                {
                    "Column": "id"
                },
                {
                    ...
                },
                {
                    "Label": "index_attachments_on_container_id_and_container_type",
                    "Columns": [
                        "container_id",
                        "container_type"
                    ]
                }
            ]
        },
        {
            "Name": "auth_sources",
            "Fields": [
                ...
            ]
        }
    ]
}

Snapshot compare command:

Usage:
  snapshot:compare <source> <destination>

Arguments:
  source       Path to the source DB snapshot (JSON file).
  destination  Path to the destination DB snapshot (JSON file)


Help:
 Compares two snapshots and outputs the differences.

Sample output:

{
    "table-diffs": {
        "attachments": {
            "field-diffs": {
                "container_type": {
                    "Type": {
                        "from": "VARCHAR",
                        "to": "INT"
                    }
                },
                "disk_filename": {
                    "Length": {
                        "from": 255,
                        "to": 500
                    },
                    "Null": {
                        "from": false,
                        "to": true
                    }
                }
            },
            "field-to-import": [
                {
                    "Id": "container_id",
                    "Type": "INT",
                    "Length": 11,
                    "Null": true,
                    "Default": 0,
                    "Comment": null,
                    "Autoincrement": false,
                    "Values": []
                }
            ],
            "field-to-delete": [
            ]
        }
    },
    "table-to-import": [],
    "table-to-delete": []
}

Sync compare command:

Usage:
  sync:compare <source> <destination>

Arguments:
  source       Source server (main / trusted). Format: USER:PASS@HOSTNAME[:PORT]/DATABASE
  destination  Destination server. Format: USER:PASS@HOSTNAME[:PORT]/DATABASE


Help:
 Compare two server DB instances and outputs their differences.

The output is the same as with the Snapshot compare command.

统计信息

  • 总下载量: 20
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固