Download the PHP package dlevsha/compalex without Composer
On this page you can find all versions of the php package dlevsha/compalex. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dlevsha/compalex
More information about dlevsha/compalex
Files in dlevsha/compalex
Package compalex
Short Description Compalex is a lightweight script to compare two database schemas. It supports MySQL, MS SQL Server and PostgreSQL
License MIT
Homepage https://github.com/dlevsha/compalex
Informations about the package compalex
README
What is Compalex?
Compalex is a lightweight script to compare two database schemas. It supports MySQL, MS SQL Server and PostgreSQL.
Try demo or visit http://compalex.net/
How to use
The easiest way to use Compalex is to use Docker.
You can build your own container using Dockerfile or use Docker Hub image:
You need to change variables for your own
DATABASE_DRIVER
- database driver, possible value
mysql
- for MySQL databasepgsql
- for PostgreSQL databasedblib
- for Microsoft SQL Server databaseoci
- for Oracle database
DATABASE_HOST
and DATABASE_HOST_SECONDARY
- database host name or IP for first and second server
If your compared DB run locally:
-
for MacOS and Windows user: use instead of in and param. Because we run script inside container we need to use Host machine IP for connection.
- for Linux user: use option and in and param.
If you connect to DB outside your machine (external IP) use: .
DATABASE_PORT
and DATABASE_PORT_SECONDARY
- database port for first and second server
Default ports for DB:
3306
- Mysql5432
- PostgreSQL1433
- MSSQL1521
- Oracle
DATABASE_NAME
and DATABASE_NAME_SECONDARY
- first and second database name
DATABASE_USER
/ DATABASE_PASSWORD
and DATABASE_USER_SECONDARY
/ DATABASE_PASSWORD_SECONDARY
- login and password to access your databases
DATABASE_DESCRIPTION
and DATABASE_DESCRIPTION_SECONDARY
- server description (not necessary). For information only. These names will display as a database name.
You can also use .
Requirements
If you prefer use Compalex as PHP script please read instruction bellow.
Compalex is only supported by PHP 5.4 and up with PDO extension.
Installation
$ git clone https://github.com/dlevsha/compalex.git
$ cd compalex
Open .environment
. You'll see configuration params
where
DATABASE_DRIVER
- database driver, possible value
mysql
- for MySQL databasepgsql
- for PostgreSQL databasedblib
- for Microsoft SQL Server databaseoci
- for Oracle database
[ Primary connection params ]
and [ Secondary connection params ]
sections describes settings for first and second databases.
Where
DATABASE_HOST
and DATABASE_HOST_SECONDARY
- database host name or IP for first and second server
DATABASE_PORT
and DATABASE_PORT_SECONDARY
- database port for first and second server
Default ports:
3306
- Mysql5432
- PostgreSQL1433
- MSSQL1521
- Oracle
DATABASE_NAME
and DATABASE_NAME_SECONDARY
- first and second database name
DATABASE_USER
/ DATABASE_PASSWORD
and DATABASE_USER_SECONDARY
/ DATABASE_PASSWORD_SECONDARY
- login and password to access your databases
DATABASE_DESCRIPTION
and DATABASE_DESCRIPTION_SECONDARY
- server description (not necessary). For information only. These names will display as a database name.
Inside compalex
directory run
$ php -S localhost:8000
Now open your browser and type http://localhost:8000/
You'll see database schema of two compared databases.
-
You can run this script in terminal (for example, if you don't have direct connection to database).
I recommend eLinks (free text-based console web browser) because it supports HTML-formatting and colors.
Install the script and run web-server as described above on your server.
Then run:
$ elinks http://localhost:8000
You'll see database schema in your terminal
Sometimes you have only SSH access to remote database server and you can't open port for external connections. In this case you can use port forwarding via SSH
ssh -L 1522:localhost:1521 [user name]@[remote host 1]
ssh -L 1523:localhost:1521 [user name]@[remote host 2]
This command will forward 1521
port from remote servers to local 1522
and 1523
respectively.
LICENSE
Copyright (c) 2021, Levsha Dmitry
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.