2017 © Pedro Peláez
 

library mysql-to-object-mapper

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

image

bogdananton/mysql-to-object-mapper

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

  • Sunday, November 1, 2015
  • by bogdananton
  • Repository
  • 1 Watchers
  • 2 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 4 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Build Status Code Climate Coverage Status, (*1)

Scans MySQL structure and converts it into PHP objects. Using MySQL file dumps or a server as input., (*2)

Download the phar file from the latest release page., (*3)

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:, (*4)

{
    "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:, (*5)

{
    "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., (*6)

The Versions

01/11 2015

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

The Development Requires

01/11 2015

1.0.2

1.0.2.0

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

  Sources   Download

MIT

The Requires

 

The Development Requires

12/04 2015

1.0.1

1.0.1.0

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

05/04 2015

1.0.0

1.0.0.0

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

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires