Download the PHP package pm-connect/db-diff-utils without Composer
On this page you can find all versions of the php package pm-connect/db-diff-utils. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package db-diff-utils
Database Diff Utils
Looking For An All-In-One DB Structure Diff Tool?
If you're looking for an all-in-one database diff tool, checkout DB Diff
Intro
A simple set of utilities to be used for generating a diff between 2 database connections and their structures (not data).
Also contains a Laravel service provider and console command that can diff 2 given databases.
- Installation
- Laravel Service Provider
- Usage
- Using The Provided Objects
- Using The Artisan Console Command
Installation
Install through composer.
Optional Add The Laravel Service Provider
Add the following line to your config/app.php
file within the providers array if you wish to use the provided artisan command.
Usage
The provided diff utilities can be used in 2 ways.
- Using the provided objects where you need them.
- Using the provided artisan console command
db:diff
.
Using The Provided Objects
The package provides the following objects for your use:
PMConnect\DBDiff\Utils\Diff
This object provides a basic wrapper to the other available objects and is capable of running a full diff.
Example Use
The Diff
object accepts in the following as constructor parameters.
PMConnect\DBDiff\Utils\Contracts\Output
- Create an implementation of this to save the output of the diff.
Illuminate\Database\Connection
- Provide connection instances to the databases you wish to diff.
- This can be done easily using
Illuminate\Database\Connectors\ConnectionFactory
- This can also be done by manually creating instances of the connections you wish to use.
Illuminate\Database\MySqlConnection
Illuminate\Database\PostgresConnection
Illuminate\Database\SQLiteConnection
Using The Laravel Artisan Console Command
This package provides an artisan console command that can diff 2 given databases for you and output the results into the console.
Provided you have added the service provider (as mentioned above) you can use the command as follows:
This command will automatically prompt for the database connection details from you, then run the diff and output any errors to the screen.
The --default-collation
option is optional and will default to 'utf8mb4_general_ci' if not provided, but can still be provided during the config of each database.
Issues
Please submit any issues using GitHubs build in issue management.